[rocprofiler-systems] Add build option for "examples" to specify gfx-arch (#2626)
## Motivation - Added `check_rocminfo` function that returns true if the provided regex was found, false otherwise. Can also use `GET_OUTPUT` to get the raw output filtered with or without a regex. - Moved `rocprofiler_systems_get_gfx_archs()` to `MacroUtilities.cmake` - Added `rocprofiler_systems_lookup_gfx()`, which detects whether a given `gfx` is from the `instinct`, `radeon` or `apu` family. - Added `ROCPROFSYS_GFX_TARGETS` as a build argument. Used to specify the offloading architectures that GPU examples should compile for. If empty, defaults to whatever your system has. - GPU examples now check if the given `gfx` targets (from `ROCPROFSYS_GFX_TARGETS`) are supported. - OMPVV offload tests now only compile if `amdflang` version is `>= 20` - Improve link time by reducing the number of GFX targets that binaries need to support. - RCCL is now passed a `GPU_TARGETS` var specifying the architectures to build/link against.
This commit is contained in:
@@ -20,14 +20,12 @@ target_link_libraries(
|
||||
)
|
||||
target_compile_options(fork-example PRIVATE ${_FLAGS})
|
||||
|
||||
if(ROCPROFSYS_INSTALL_EXAMPLES)
|
||||
if(TARGET fork-example)
|
||||
install(
|
||||
TARGETS fork-example
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/rocprofiler-systems/examples
|
||||
COMPONENT rocprofiler-systems-examples
|
||||
)
|
||||
endif()
|
||||
if(ROCPROFSYS_INSTALL_EXAMPLES AND TARGET fork-example)
|
||||
install(
|
||||
TARGETS fork-example
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/rocprofiler-systems/examples
|
||||
COMPONENT rocprofiler-systems-examples
|
||||
)
|
||||
endif()
|
||||
|
||||
# HIP fork example (multi-process concurrency test)
|
||||
@@ -64,6 +62,18 @@ if(HIPCC_EXECUTABLE)
|
||||
)
|
||||
add_executable(hipMallocConcurrencyMproc hipMallocConcurrencyMproc.cpp)
|
||||
target_link_libraries(hipMallocConcurrencyMproc PRIVATE Threads::Threads)
|
||||
set_target_properties(
|
||||
hipMallocConcurrencyMproc
|
||||
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/fork"
|
||||
)
|
||||
# Specify GPU architectures to compile for
|
||||
foreach(arch IN LISTS ROCPROFSYS_GFX_TARGETS)
|
||||
target_compile_options(
|
||||
hipMallocConcurrencyMproc
|
||||
PRIVATE --offload-arch=${arch}
|
||||
)
|
||||
target_link_options(hipMallocConcurrencyMproc PUBLIC --offload-arch=${arch})
|
||||
endforeach()
|
||||
|
||||
if(
|
||||
CMAKE_CXX_COMPILER_ID MATCHES "Clang"
|
||||
|
||||
Reference in New Issue
Block a user