From 9bacfe599d0b5dc457c0fc813655486a03812e1c Mon Sep 17 00:00:00 2001 From: Slavko Brdar Date: Tue, 15 Oct 2024 00:55:41 +0300 Subject: [PATCH] make compile and run on Lumi --- hic/src/hic/hic_runtime.h | 20 +++++++++---------- pluto/examples/CMakeLists.txt | 3 +++ pluto/src/CMakeLists.txt | 6 +++--- .../pluto/memory_resource/memory_resource.h | 2 +- pluto/tests/sandbox/CMakeLists.txt | 3 +++ 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/hic/src/hic/hic_runtime.h b/hic/src/hic/hic_runtime.h index 602c5c52f..c8b8bc7d2 100644 --- a/hic/src/hic/hic_runtime.h +++ b/hic/src/hic/hic_runtime.h @@ -23,17 +23,17 @@ #include #elif HIC_BACKEND_HIP #define HIC_BACKEND hip - #if defined(DEPRECATED) - #define DEFINED_OUTERSCOPE DEPRECATED - #undef DEPRECATED - #endif +//#if defined(DEPRECATED) +// #define DEFINED_OUTERSCOPE DEPRECATED +// #undef DEPRECATED +// #endif #include - #if defined(DEPRECATED) - #undef DEPRECATED - #endif - #if defined(DEFINED_OUTERSCOPE) - #define DEPRECATED DEFINED_OUTERSCOPE - #endif +// #if defined(DEPRECATED) +// #undef DEPRECATED +// #endif +// #if defined(DEFINED_OUTERSCOPE) +// #define DEPRECATED DEFINED_OUTERSCOPE +// #endif #if HIP_VERSION_MAJOR < 6 enum hicMemoryType { diff --git a/pluto/examples/CMakeLists.txt b/pluto/examples/CMakeLists.txt index a29644512..dde9cea5c 100644 --- a/pluto/examples/CMakeLists.txt +++ b/pluto/examples/CMakeLists.txt @@ -7,6 +7,9 @@ function( add_example target ) target_host_device_sources( ${target} PRIVATE ${_PAR_UNPARSED_ARGUMENTS}) target_link_libraries( ${target} PRIVATE pluto ) target_include_directories( ${target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) + if (ENABLE_HIP) + set_target_properties(${target} PROPERTIES LINKER_LANGUAGE HIP) + endif() endfunction() add_example(is_on_device is_on_device.cc) diff --git a/pluto/src/CMakeLists.txt b/pluto/src/CMakeLists.txt index dd3af8143..941639b8b 100644 --- a/pluto/src/CMakeLists.txt +++ b/pluto/src/CMakeLists.txt @@ -7,7 +7,7 @@ # does it submit to any jurisdiction. -pluto_host_device( pluto_host_device_src SOURCE pluto/device/MemoryResource.cc) +#pluto_host_device( pluto_host_device_src SOURCE pluto/device/MemoryResource.cc) set(PLUTO_HAVE_CUDA ${HAVE_CUDA} ) set(PLUTO_HAVE_HIP ${HAVE_HIP} ) @@ -26,8 +26,8 @@ install( FILES ecbuild_add_library( TARGET pluto SOURCES - ${pluto_host_device_src} - + #!${pluto_host_device_src} + pluto/device/MemoryResource.cc pluto/device/allocator.h pluto/device/make_copy.h pluto/device/MemoryResource.h diff --git a/pluto/src/pluto/memory_resource/memory_resource.h b/pluto/src/pluto/memory_resource/memory_resource.h index 8fa4ead5c..0587d9154 100644 --- a/pluto/src/pluto/memory_resource/memory_resource.h +++ b/pluto/src/pluto/memory_resource/memory_resource.h @@ -37,7 +37,7 @@ using pool_options = STD_PMR::pool_options; inline memory_resource* null_memory_resource() { return STD_PMR::null_memory_resource(); } inline memory_resource* new_delete_resource() { return STD_PMR::new_delete_resource(); } inline memory_resource* get_default_resource() { - init(); + //init(); return STD_PMR::get_default_resource(); } inline void set_default_resource(memory_resource* mr) { STD_PMR::set_default_resource(mr); } diff --git a/pluto/tests/sandbox/CMakeLists.txt b/pluto/tests/sandbox/CMakeLists.txt index c15954536..42d05951e 100644 --- a/pluto/tests/sandbox/CMakeLists.txt +++ b/pluto/tests/sandbox/CMakeLists.txt @@ -7,6 +7,9 @@ function( add_sandbox target ) target_host_device_sources( ${target} PRIVATE ${_PAR_UNPARSED_ARGUMENTS}) target_link_libraries( ${target} PRIVATE pluto ) target_include_directories( ${target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) + if( ENABLE_HIP ) + set_target_properties(${target} PROPERTIES LINKER_LANGUAGE HIP ) + endif() endfunction() add_sandbox(pluto-sandbox sandbox.cc kernel.cc)