Skip to content

Commit

Permalink
set device
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Sep 21, 2024
1 parent 95449d3 commit f9810e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Tests/GPU/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

using namespace amrex;

#if defined(AMREX_USE_GPU)
#endif

int main (int argc, char* argv[])
{
amrex::ignore_unused(argc, argv);

#ifdef AMREX_USE_SYCL
#if defined(AMREX_USE_CUDA)
AMREX_CUDA_SAFE_CALL(cudaSetDevice(0));
#elif defined(AMREX_USE_HIP)
AMREX_HIP_SAFE_CALL(hipSetDevice(0));
#elif defined(AMREX_USE_SYCL)
sycl::device sycl_device(sycl::gpu_selector_v);
sycl::context sycl_context(sycl_device);
sycl::queue sycl_queue(sycl_context, sycl_device,
Expand Down
4 changes: 4 additions & 0 deletions Tools/GNUMake/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ else ifeq ($(USE_HIP),TRUE)
AMD_ARCH = $(AMREX_AMD_ARCH)
endif

ifeq ($(AMD_ARCH),)
$(error Must set AMD_ARCH)
endif

ifeq ($(HIP_SAVE_TEMPS),TRUE)
ifeq ($(USE_GPU_RDC),TRUE)
$(warning *** HIP_SAVE_TEMPS requires USE_GPU_RDC=FALSE to obtain the assembly files for AMD GPU kernels.)
Expand Down

0 comments on commit f9810e5

Please sign in to comment.