Ignore:
Timestamp:
12/04/11 22:08:32 (3 years ago)
Author:
wezowicz
Message:

Fixed memory leak in opencl-domain-memory.inl.
Add OpenCL specialization to muladd() along with 8 more kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/wezzy/linbox/algorithms/opencl-kernels/kernel_muladd_partial_8_dp.cl

    r4072 r4090  
    99#pragma OPENCL EXTENSION cl_khr_fp64 : enable 
    1010 
    11 __kernel void matrix_mul_kernel(__global double* C, __global double* A, __global double* B, 
    12                 int width_A, int width_B, double mod){ 
     11__kernel void matrix_mul_kernel(__global double* D, double alpha, __global double* A, __global double* B, 
     12                double beta, __global double* C, int width_A, int width_B, double mod){ 
    1313        //Get Workgroup ID 
    1414        int bx = get_group_id(0); 
     
    6464         
    6565        //Scale Dsub by alpha 
    66         Dsub = fmod((alpha * Dsub), mod); 
     66        Dsub = alpha * Dsub; 
     67        Dsub = fmod(Dsub, mod); 
    6768         
    68         if(beta != 0.0){ 
    69                 //Add C scaled by beta to Dsub 
    70                 double Csub = fmod((beta * C[d + ty * width_B + tx]), mod); 
    71                 Dsub = fmod((Dsub + Csub), mod); 
    72         } 
     69        //Scalse Csub by beta 
     70        double Csub = C[d + ty * width_B + tx]; 
     71        Csub = beta * Csub; 
     72        Csub = fmod(Csub, mod); 
     73         
     74        //Add Dsub and Dsub 
     75        Dsub = Dsub + Csub; 
     76        Dsub = fmod(Dsub, mod); 
    7377         
    7478        //Add the sum to the appropriate spot 
Note: See TracChangeset for help on using the changeset viewer.