diff --git a/CMakeLists.txt b/CMakeLists.txt index 6815d270..31af832b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,9 +77,9 @@ else() endif() set(HIP_PATH "${ROCM_PATH}/hip" CACHE STRING "path to HIP installation") if(GTENSOR_GPU_ARCHITECTURES STREQUAL "default") - set(HIP_GPU_ARCHITECTURE "gfx90a") + set(CMAKE_HIP_ARCHITECTURES "gfx90a") else() - set(CMAKE_CUDA_ARCHITECTURES ${GTENSOR_GPU_ARCHITECTURES}) + set(CMAKE_HIP_ARCHITECTURES ${GTENSOR_GPU_ARCHITECTURES}) endif() # SYCL specific configuration @@ -201,8 +201,8 @@ if ("hip" IN_LIST GTENSOR_BUILD_DEVICES) target_compile_definitions(gtensor_hip INTERFACE GTENSOR_HAVE_DEVICE) target_compile_definitions(gtensor_hip INTERFACE GTENSOR_DEVICE_HIP) - set(GPU_TARGETS "${HIP_GPU_ARCHITECTURES}" - CACHE STRING "GPU targets to compile for") + #set(GPU_TARGETS "${HIP_GPU_ARCHITECTURES}" + # CACHE STRING "GPU targets to compile for") find_package(hip REQUIRED) find_package(rocthrust REQUIRED) diff --git a/include/gtensor/macros.h b/include/gtensor/macros.h index b978d158..2eff9c3d 100644 --- a/include/gtensor/macros.h +++ b/include/gtensor/macros.h @@ -90,8 +90,10 @@ inline auto gpuGetLastError() { return cudaGetLastError(); } inline void gtLaunchCheck(dim3 numblocks, dim3 numthreads, const char* file, int line) { - if (hipGetLastError() != hipSuccess) { - fprintf(stderr, "launch failed %s %d\n", file, line); + hipError_t last_error = hipGetLastError(); + if (last_error != hipSuccess) { + fprintf(stderr, "launch failed %s %d, error_code: %d\n", file, line,last_error); + fprintf(stderr, "(%s)\n", hipGetErrorString(last_error)); fprintf(stderr, "blocks was [%d, %d, %d]\n", numblocks.x, numblocks.y, numblocks.z); fprintf(stderr, "threads was [%d, %d, %d]\n", numthreads.x, numthreads.y,