From dd92a59939805d42d2ce34bbe7bf8c680ddfa6c4 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/clr commit: 793dc2bce0c34d4684d110550d3d5d1ecf342c2f] --- projects/clr/hipamd/samples/0_Intro/module_api/Makefile | 4 ++-- .../clr/hipamd/samples/0_Intro/module_api/vcpy_kernel.cu | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 projects/clr/hipamd/samples/0_Intro/module_api/vcpy_kernel.cu diff --git a/projects/clr/hipamd/samples/0_Intro/module_api/Makefile b/projects/clr/hipamd/samples/0_Intro/module_api/Makefile index 99cff6bc0a..2570290f07 100644 --- a/projects/clr/hipamd/samples/0_Intro/module_api/Makefile +++ b/projects/clr/hipamd/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/clr/hipamd/samples/0_Intro/module_api/vcpy_kernel.cu b/projects/clr/hipamd/samples/0_Intro/module_api/vcpy_kernel.cu new file mode 100644 index 0000000000..ead7d70311 --- /dev/null +++ b/projects/clr/hipamd/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]; + +}