Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:49

0001 #include <cstddef>
0002 
0003 #include <hip/hip_runtime.h>
0004 
0005 #include "HeterogeneousTest/ROCmKernel/interface/DeviceAdditionKernel.h"
0006 #include "HeterogeneousTest/ROCmWrapper/interface/DeviceAdditionWrapper.h"
0007 #include "HeterogeneousCore/ROCmUtilities/interface/hipCheck.h"
0008 
0009 namespace cms::rocmtest {
0010 
0011   void wrapper_add_vectors_f(const float* __restrict__ in1,
0012                              const float* __restrict__ in2,
0013                              float* __restrict__ out,
0014                              size_t size) {
0015     // launch the 1-dimensional kernel for vector addition
0016     kernel_add_vectors_f<<<32, 32>>>(in1, in2, out, size);
0017     hipCheck(hipGetLastError());
0018   }
0019 
0020   void wrapper_add_vectors_d(const double* __restrict__ in1,
0021                              const double* __restrict__ in2,
0022                              double* __restrict__ out,
0023                              size_t size) {
0024     // launch the 1-dimensional kernel for vector addition
0025     kernel_add_vectors_d<<<32, 32>>>(in1, in2, out, size);
0026     hipCheck(hipGetLastError());
0027   }
0028 
0029 }  // namespace cms::rocmtest