diff --git a/samples/0_Intro/module_api/Makefile b/samples/0_Intro/module_api/Makefile index bda0a7dd93..81e876ddbf 100644 --- a/samples/0_Intro/module_api/Makefile +++ b/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/samples/0_Intro/module_api/runKernel.cpp b/samples/0_Intro/module_api/runKernel.cpp index 8c1ed1598f..c6bba63b06 100644 --- a/samples/0_Intro/module_api/runKernel.cpp +++ b/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;