From e9f4f40a459710bbd6e484deb0b647587dbd1114 Mon Sep 17 00:00:00 2001 From: pensun Date: Sat, 3 Sep 2016 21:06:58 -0500 Subject: [PATCH] For module_api sample, use vcpy_kernel.cu to generate ptx file for NV path. Change-Id: Id0033678834288c4eaa56b12e7d447119be99deb [ROCm/hip commit: e08f4513c18c1546b3d8c982704e75a9dff2f782] --- projects/hip/samples/0_Intro/module_api/Makefile | 4 ++-- projects/hip/samples/0_Intro/module_api/vcpy_kernel.cu | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 projects/hip/samples/0_Intro/module_api/vcpy_kernel.cu diff --git a/projects/hip/samples/0_Intro/module_api/Makefile b/projects/hip/samples/0_Intro/module_api/Makefile index 99cff6bc0a..2570290f07 100644 --- a/projects/hip/samples/0_Intro/module_api/Makefile +++ b/projects/hip/samples/0_Intro/module_api/Makefile @@ -21,8 +21,8 @@ endif ifeq (${HIP_PLATFORM}, nvcc) -vcpy_kernel.compile: vcpy_kernel.cpp - $(HIPCC) --genco vcpy_kernel.cpp -o vcpy_kernel.ptx +vcpy_kernel.compile: vcpy_kernel.cu + $(HIPCC) --genco vcpy_kernel.cu -o vcpy_kernel.ptx clean: rm -f *.ptx *.out diff --git a/projects/hip/samples/0_Intro/module_api/vcpy_kernel.cu b/projects/hip/samples/0_Intro/module_api/vcpy_kernel.cu new file mode 100644 index 0000000000..ead7d70311 --- /dev/null +++ b/projects/hip/samples/0_Intro/module_api/vcpy_kernel.cu @@ -0,0 +1,6 @@ +extern "C" __global__ void hello_world(float *a, float *b) +{ + int tx = threadIdx.x; + b[tx] = a[tx]; + +}