Replace hipLaunchKernel -> hipLaunchKernelGGL
Change-Id: I4d99009e1199811d417becf1e1b934ec4d4e30be
Этот коммит содержится в:
@@ -31,7 +31,7 @@ THE SOFTWARE.
|
||||
#define NUM 1024
|
||||
#define SIZE NUM * sizeof(float)
|
||||
|
||||
__global__ void vAdd(hipLaunchParm lp, float* In1, float* In2, float* In3, float* In4, float* Out) {
|
||||
__global__ void vAdd(float* In1, float* In2, float* In3, float* In4, float* Out) {
|
||||
int tid = threadIdx.x + blockIdx.x * blockDim.x;
|
||||
In4[tid] = In1[tid] + In2[tid];
|
||||
__threadfence();
|
||||
@@ -66,7 +66,7 @@ int main() {
|
||||
hipMemcpy(In3d, In3, SIZE, hipMemcpyHostToDevice);
|
||||
hipMemcpy(In4d, In4, SIZE, hipMemcpyHostToDevice);
|
||||
|
||||
hipLaunchKernel(vAdd, dim3(32, 1, 1), dim3(32, 1, 1), 0, 0, In1d, In2d, In3d, In4d, Outd);
|
||||
hipLaunchKernelGGL(vAdd, dim3(32, 1, 1), dim3(32, 1, 1), 0, 0, In1d, In2d, In3d, In4d, Outd);
|
||||
hipMemcpy(Out, Outd, SIZE, hipMemcpyDeviceToHost);
|
||||
assert(Out[10] == 2 * In1[10] + 2 * In2[10] + In3[10]);
|
||||
passed();
|
||||
|
||||
Ссылка в новой задаче
Block a user