From 6ee30001c17d0487802429d52fd51ff4dc456b45 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Sun, 4 Sep 2016 21:25:14 +0530 Subject: [PATCH] module_api sample: Remove unnecessary platform checks Change-Id: I1d531264d51ff952a3a68d554672b6d293e23379 [ROCm/hip-tests commit: e2469d5c553d455fcf837e41c840b64af17e0000] --- .../samples/0_Intro/module_api/Makefile | 29 ++++++------------- .../samples/0_Intro/module_api/runKernel.cpp | 9 +----- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/projects/hip-tests/samples/0_Intro/module_api/Makefile b/projects/hip-tests/samples/0_Intro/module_api/Makefile index bda0a7dd93..81e876ddbf 100644 --- a/projects/hip-tests/samples/0_Intro/module_api/Makefile +++ b/projects/hip-tests/samples/0_Intro/module_api/Makefile @@ -3,31 +3,20 @@ ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif HIPCC=$(HIP_PATH)/bin/hipcc -OPT= HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --compiler) -all: vcpy_kernel.compile runKernel.hip.out +ifeq (${HIP_PLATFORM}, hcc) + GENCO_FLAGS=--target-isa=fiji +endif + +all: vcpy_kernel.code runKernel.hip.out runKernel.hip.out: runKernel.cpp - $(HIPCC) $(OPT) runKernel.cpp -o runKernel.hip.out + $(HIPCC) $(HIPCC_FLAGS) $< -o $@ -ifeq (${HIP_PLATFORM}, hcc) - -vcpy_kernel.compile: vcpy_kernel.cpp - $(HIPCC) --genco --target-isa=fiji vcpy_kernel.cpp -o vcpy_kernel.co +vcpy_kernel.code: vcpy_kernel.cpp + $(HIPCC) --genco $(GENCO_FLAGS) $< -o $@ clean: - rm -f *.co *.out - -endif - -ifeq (${HIP_PLATFORM}, nvcc) - -vcpy_kernel.compile: vcpy_kernel.cpp - $(HIPCC) --genco vcpy_kernel.cpp -o vcpy_kernel.ptx - -clean: - rm -f *.ptx *.out - -endif + rm -f *.code *.out diff --git a/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp b/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp index 8c1ed1598f..c6bba63b06 100644 --- a/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp +++ b/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp @@ -26,15 +26,8 @@ THE SOFTWARE. #define LEN 64 #define SIZE LEN<<2 -#ifdef __HIP_PLATFORM_HCC__ -#define fileName "vcpy_kernel.co" +#define fileName "vcpy_kernel.code" #define kernel_name "hello_world" -#endif - -#ifdef __HIP_PLATFORM_NVCC__ -#define fileName "vcpy_kernel.ptx" -#define kernel_name "hello_world" -#endif int main(){ float *A, *B;