CMS 3D CMS Logo

DeviceAdditionWrapper.hip.cc
Go to the documentation of this file.
1 #include <cstddef>
2 
3 #include <hip/hip_runtime.h>
4 
8 
9 namespace cms::rocmtest {
10 
11  void wrapper_add_vectors_f(const float* __restrict__ in1,
12  const float* __restrict__ in2,
13  float* __restrict__ out,
14  size_t size) {
15  // launch the 1-dimensional kernel for vector addition
16  kernel_add_vectors_f<<<32, 32>>>(in1, in2, out, size);
17  hipCheck(hipGetLastError());
18  }
19 
20  void wrapper_add_vectors_d(const double* __restrict__ in1,
21  const double* __restrict__ in2,
22  double* __restrict__ out,
23  size_t size) {
24  // launch the 1-dimensional kernel for vector addition
25  kernel_add_vectors_d<<<32, 32>>>(in1, in2, out, size);
26  hipCheck(hipGetLastError());
27  }
28 
29 } // namespace cms::rocmtest
void wrapper_add_vectors_f(const float *__restrict__ in1, const float *__restrict__ in2, float *__restrict__ out, size_t size)
#define hipCheck(ARG,...)
Definition: hipCheck.h:52
void wrapper_add_vectors_d(const double *__restrict__ in1, const double *__restrict__ in2, double *__restrict__ out, size_t size)