0

Is there elementwise multiplication in cublas? I am trying to perform these Matlab operations

x .* s
x ./ s

I have on host implementation using for loop and another CUDA one, but I wonder if I missed cublas library function that can do it in an optimized way.

here is my CUDA kernel

__global__ void elementMul(double *A, double *B, double *C){
           int i = threadIdx.x;
           C[i] = A[i] * B[i];
       }    
Karam Abo Ghalieh
  • 428
  • 1
  • 5
  • 19
  • can I post my Cuda kernel as answers – Karam Abo Ghalieh Jul 19 '17 at 05:54
  • No the question is closed. I very much doubt anyone wants to set or user your CUDA code. There are many tens of questions with answers containing optimal implements of element-wise operations on matrices and vectors – talonmies Jul 19 '17 at 06:00
  • https://stackoverflow.com/q/20481390/681865 for one example, and https://stackoverflow.com/questions/32955924/cuda-function-application-elementwise-in-cuda for another – talonmies Jul 19 '17 at 06:38
  • I am working on vectors and matrices concatenating now and didn't find any question regarding that and at the same time afraid to post a question – Karam Abo Ghalieh Jul 19 '17 at 07:07

0 Answers0