make hip-tests compileable with TheRock (#1624)
## Motivation Resolved: SWDEV-566226 The current implementation of agents inside of rocprof-systems keeps just the minimal necessary set of information required for populating the `info_agent` table inside of rocpd database. There is a sufficient amount of data that is being left out from database, so this change should fix that and store the additional agent information as an `extdata` row inside of `info_agent` table. ## Technical Details This PR introduces additional filed inside of `agent` structure inside which is representing the JSON formatted string of all the additional information we can acquire about particular agent. This data is processed and added during the initial fetching of agents, and afterwards pushed inside of the database. --------- Co-authored-by: David Galiffi <David.Galiffi@amd.com> * SWDEV-557412 - Incorporate proper chunk offset when remapping virtual memory (#1848) * SWDEV-557412 - Incorporate proper offset when remapping virtual memory * Fix condition to check if VMHeap allocation address matches a chunk address * Move offset calculation outside if/else block --------- Co-authored-by: JeniferC99 <150404595+JeniferC99@users.noreply.github.com> * SWDEV-567852 - Clean-up hip::init() (#1948) * SWDEV-559267 - Use CLPrint to DevLogPrintf with Log Level - detail debug. (#1160) * SWDEV-548892 - Stop using ocml isinf wrapper (#1854) * SWDEV-562708 - change default maximum SVM size to 256GB (#1731) * SWDEV-503089 - Fix and enable disabled HIP tests from math group (#1319) * SWDEV-503089 - Fix and enable disabled HIP tests from math group * SWDEV-503089 - Move single precision reduced run to a common function * SWDEV-548892 - Stop using ockl steadyctr function (#1882) Directly use the builtin * Implement PTL support (#1957) * Implement PTL support Signed-off-by: adapryor <Adam.pryor@amd.com> (cherry picked from commit 45bc31292e7940a3b8fca044ef7df22047b95733) Signed-off-by: Maisam Arif <Maisam.Arif@amd.com> --------- Signed-off-by: adapryor <Adam.pryor@amd.com> Signed-off-by: Maisam Arif <Maisam.Arif@amd.com> Co-authored-by: Maisam Arif <Maisam.Arif@amd.com> * SWDEV-558080 - Add recommended granularity (#1176) * Add recommended granularity * Improve granularity testing * Update based on feedback * Fix and enable VMM tests on cuda (#1855) * Fix and enable VMM tests on cuda * Minor syntax fixes --------- Co-authored-by: Rahul Manocha <rmanocha@amd.com> * [rocprofiler-systems] Add support for ompt_callback_thread_begin (#1681) * Add thread_begin callback * Make OMPT callbacks that are instant have start_ts = end_ts * SWDEV-567514: Remove default stream wait (#1977) - when virtual map command is called - can create deadlock Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> * Fix flaky test Unit_hipStreamAddCallback_StrmSyncTiming (#2022) * Review comments * skip the 3 failing tests to merge hip-tests rocm-systems PR --------- Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com> Signed-off-by: adapryor <Adam.pryor@amd.com> Signed-off-by: Maisam Arif <Maisam.Arif@amd.com> Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Co-authored-by: GunaShekar <agunashe@amd.com> Co-authored-by: agunashe <ajay.gunashekar@amd.com> Co-authored-by: Ethan Trinh <Ethan.Trinh@amd.com> Co-authored-by: JeniferC99 <150404595+JeniferC99@users.noreply.github.com> Co-authored-by: Victor Zhang <111778801+victzhan@users.noreply.github.com> Co-authored-by: German Andryeyev <56892148+gandryey@users.noreply.github.com> Co-authored-by: usrihari123 <srihari.u@amd.com> Co-authored-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com> Co-authored-by: anujshuk-amd <anujshuk@amd.com> Co-authored-by: itrowbri <Ian.Trowbridge@amd.com> Co-authored-by: marantic-amd <marantic@amd.com> Co-authored-by: David Galiffi <David.Galiffi@amd.com> Co-authored-by: cadolphe-amd <chris.adolphe@amd.com> Co-authored-by: Karthik Jayaprakash <54370791+kjayapra-amd@users.noreply.github.com> Co-authored-by: Matt Arsenault <Matthew.Arsenault@amd.com> Co-authored-by: Todd tiantuo Li <88386084+lttamd@users.noreply.github.com> Co-authored-by: amilanov-amd <Aleksandar.Milanov@amd.com> Co-authored-by: Adam Pryor <61172547+adam360x@users.noreply.github.com> Co-authored-by: Maisam Arif <Maisam.Arif@amd.com> Co-authored-by: AidanBeltonS <abeltons@amd.com> Co-authored-by: Rahul Manocha <153310294+manocharahul@users.noreply.github.com> Co-authored-by: Rahul Manocha <rmanocha@amd.com> Co-authored-by: Kian Cossettini <Kian.Cossettini@amd.com> Co-authored-by: Shadi Dashmiz <94885391+shadidashmiz@users.noreply.github.com> Co-authored-by: Ioannis Assiouras <38722728+iassiour@users.noreply.github.com> Co-authored-by: Ajay GunaShekar <86270081+agunashe@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
# THE SOFTWARE.
|
||||
|
||||
add_subdirectory(rtc)
|
||||
add_subdirectory(deviceLib)
|
||||
add_subdirectory(graph)
|
||||
add_subdirectory(memory)
|
||||
add_subdirectory(stream)
|
||||
@@ -39,28 +38,32 @@ add_subdirectory(context)
|
||||
add_subdirectory(device_memory)
|
||||
add_subdirectory(warp)
|
||||
add_subdirectory(dynamicLoading)
|
||||
add_subdirectory(c_compilation)
|
||||
add_subdirectory(g++)
|
||||
#add_subdirectory(gcc) # TODO link error TheRock build
|
||||
add_subdirectory(module)
|
||||
add_subdirectory(channelDescriptor)
|
||||
add_subdirectory(executionControl)
|
||||
add_subdirectory(math)
|
||||
add_subdirectory(vector_types)
|
||||
add_subdirectory(atomics)
|
||||
add_subdirectory(complex)
|
||||
add_subdirectory(p2p)
|
||||
add_subdirectory(gcc)
|
||||
add_subdirectory(syncthreads)
|
||||
add_subdirectory(threadfence)
|
||||
add_subdirectory(virtualMemoryManagement)
|
||||
add_subdirectory(c_compilation)
|
||||
|
||||
# TODO Rock build failures
|
||||
if(UNIX)
|
||||
add_subdirectory(math)
|
||||
# TODO compute build failures
|
||||
add_subdirectory(deviceLib)
|
||||
add_subdirectory(syncthreads)
|
||||
endif()
|
||||
if(HIP_PLATFORM STREQUAL "amd")
|
||||
add_subdirectory(callback)
|
||||
add_subdirectory(clock)
|
||||
add_subdirectory(hip_specific)
|
||||
# Vulkan interop APIs currently undefined for Nvidia
|
||||
add_subdirectory(vulkan_interop)
|
||||
add_subdirectory(gl_interop) # Disabled on NVIDIA due to defect - EXSWHTEC-246
|
||||
add_subdirectory(callback)
|
||||
add_subdirectory(clock)
|
||||
add_subdirectory(hip_specific)
|
||||
# Vulkan interop APIs currently undefined for Nvidia
|
||||
add_subdirectory(vulkan_interop)
|
||||
add_subdirectory(gl_interop) # Disabled on NVIDIA due to defect - EXSWHTEC-246
|
||||
endif()
|
||||
add_subdirectory(synchronization)
|
||||
add_subdirectory(launchBounds)
|
||||
|
||||
@@ -34,7 +34,7 @@ elseif(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME AssertionTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -54,4 +54,4 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC})
|
||||
# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# static_assert_kernels_negative.cc 2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -62,7 +62,7 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME AtomicsTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
|
||||
if(UNIX)
|
||||
set(EXPECTED_ERRORS 40)
|
||||
@@ -147,4 +147,4 @@ if(UNIX)
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# atomicExch_system_negative_kernels.cc 40)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -22,18 +22,19 @@ set(TEST_SRC
|
||||
hipGetDeviceProp.cc
|
||||
)
|
||||
|
||||
set (PLATFORM_DEFINE __HIP_PLATFORM_AMD__)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "nvidia")
|
||||
set (PLATFORM_DEFINE __HIP_PLATFORM_NVIDIA__)
|
||||
set(PLATFORM_DEFINE __HIP_PLATFORM_NVIDIA__)
|
||||
else()
|
||||
set(PLATFORM_DEFINE __HIP_PLATFORM_AMD__)
|
||||
endif()
|
||||
|
||||
# Creating Custom object file
|
||||
add_custom_target(devprop_c_custom
|
||||
COMMAND ${HIP_PATH}/bin/hipcc
|
||||
-c -Wno-deprecated-declarations ${CMAKE_CURRENT_SOURCE_DIR}/hipGetDeviceProp.c
|
||||
-I${HIP_PATH}/include
|
||||
COMMAND ${CMAKE_C_COMPILER}
|
||||
-c -Wno-deprecated-declarations -x c ${CMAKE_CURRENT_SOURCE_DIR}/hipGetDeviceProp.c
|
||||
-I${HIP_INCLUDE_DIR}
|
||||
-D${PLATFORM_DEFINE}
|
||||
--hip-path=${HIP_PATH}
|
||||
-o hipGetDeviceProp.o
|
||||
BYPRODUCTS hipGetDeviceProp.o
|
||||
)
|
||||
|
||||
@@ -29,11 +29,11 @@ set(TEST_SRC
|
||||
if(UNIX)
|
||||
set(TEST_SRC ${TEST_SRC} hipKernelNameRefByPtr.cc)
|
||||
|
||||
add_custom_target(SimpleKernel.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SimpleKernel.cc
|
||||
add_custom_target(SimpleKernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/SimpleKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/callback/SimpleKernel.code
|
||||
-I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
--hip-path=${HIP_PATH})
|
||||
-I${HIP_INCLUDE_DIR}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/SimpleKernel.code)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -20,6 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
extern "C" __global__ void simple_kernel() { printf("Hello World!"); }
|
||||
|
||||
@@ -74,8 +74,10 @@ TEST_CASE("Unit_hipApiName_Positive_Basic") {
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
TEST_CASE("Unit_hipApiName_Negative_ReservedIds") {
|
||||
REQUIRE_THAT(hipApiName(std::numeric_limits<uint32_t>::min()), Catch::Equals(kUnknownApi));
|
||||
REQUIRE_THAT(hipApiName(std::numeric_limits<uint32_t>::max()), Catch::Equals(kUnknownApi));
|
||||
REQUIRE_THAT(hipApiName(std::numeric_limits<uint32_t>::min()),
|
||||
Catch::Matchers::Equals(kUnknownApi));
|
||||
REQUIRE_THAT(hipApiName(std::numeric_limits<uint32_t>::max()),
|
||||
Catch::Matchers::Equals(kUnknownApi));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,15 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
set(OFFLOAD_ARCH_GENERIC_STR "--offload-arch=gfx9-generic --offload-arch=gfx9-4-generic:sramecc+:xnack- --offload-arch=gfx9-4-generic:sramecc-:xnack- --offload-arch=gfx9-4-generic:xnack+ --offload-arch=gfx10-1-generic --offload-arch=gfx10-3-generic --offload-arch=gfx11-generic --offload-arch=gfx12-generic")
|
||||
set(OFFLOAD_ARCH_GENERIC_STR
|
||||
--offload-arch=gfx9-generic
|
||||
--offload-arch=gfx9-4-generic:sramecc+:xnack-
|
||||
--offload-arch=gfx9-4-generic:sramecc-:xnack-
|
||||
--offload-arch=gfx9-4-generic:xnack+
|
||||
--offload-arch=gfx10-1-generic
|
||||
--offload-arch=gfx10-3-generic
|
||||
--offload-arch=gfx11-generic
|
||||
--offload-arch=gfx12-generic)
|
||||
|
||||
set(DISABLE_GENERIC_TARGET_ONLY)
|
||||
|
||||
@@ -30,40 +38,34 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
set(GENERIC_TARGET_ONLY_COMPRESSED_EXE hipSquareGenericTargetOnlyCompressed)
|
||||
|
||||
set(LIBFS)
|
||||
set(HIP_GENERIC_RPATH)
|
||||
if(WIN32)
|
||||
set(GENERIC_TARGET_ONLY_EXE ${GENERIC_TARGET_ONLY_EXE}.exe)
|
||||
set(GENERIC_TARGET_ONLY_COMPRESSED_EXE ${GENERIC_TARGET_ONLY_COMPRESSED_EXE}.exe)
|
||||
else()
|
||||
set(LIBFS -lstdc++fs)
|
||||
set(HIP_GENERIC_RPATH
|
||||
-Wl,-rpath,'$$ORIGIN/../lib:${HIP_PATH}/lib')
|
||||
if(NOT WIN32)
|
||||
set(LIBFS -lstdc++fs)
|
||||
endif()
|
||||
|
||||
add_custom_target(hipSquareGenericTargetOnly ALL
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -DNO_GENERIC_TARGET_ONLY_TEST --std=c++17 -mcode-object-version=6 -w "${OFFLOAD_ARCH_GENERIC_STR}"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hipSquareGenericTarget.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/hip_test_context.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/hip_test_features.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/main.cc
|
||||
${HIP_GENERIC_RPATH}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${GENERIC_TARGET_ONLY_EXE}
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../external/Catch2
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../external/picojson ${LIBFS})
|
||||
add_custom_target(hipSquareGenericTargetOnlyCompressed ALL
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -DNO_GENERIC_TARGET_ONLY_TEST -DGENERIC_COMPRESSED --std=c++17 -mcode-object-version=6 --offload-compress -w "${OFFLOAD_ARCH_GENERIC_STR}"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hipSquareGenericTarget.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/hip_test_context.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/hip_test_features.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/main.cc
|
||||
${HIP_GENERIC_RPATH}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${GENERIC_TARGET_ONLY_COMPRESSED_EXE}
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../external/Catch2
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../external/picojson ${LIBFS})
|
||||
set_source_files_properties(hipSquareGenericTarget.cc PROPERTIES LANGUAGE HIP)
|
||||
add_executable(${GENERIC_TARGET_ONLY_EXE}
|
||||
hipSquareGenericTarget.cc
|
||||
$<TARGET_OBJECTS:Main_Object>)
|
||||
target_compile_options(${GENERIC_TARGET_ONLY_EXE} PUBLIC -w ${OFFLOAD_ARCH_GENERIC_STR})
|
||||
target_link_libraries(${GENERIC_TARGET_ONLY_EXE} hip::host hip::device)
|
||||
target_compile_definitions(${GENERIC_TARGET_ONLY_EXE} PRIVATE NO_GENERIC_TARGET_ONLY_TEST)
|
||||
if(NOT USE_PREBUILT_CATCH)
|
||||
target_link_libraries(${GENERIC_TARGET_ONLY_EXE} Catch2::Catch2WithMain)
|
||||
endif()
|
||||
|
||||
add_executable(${GENERIC_TARGET_ONLY_COMPRESSED_EXE}
|
||||
hipSquareGenericTarget.cc
|
||||
$<TARGET_OBJECTS:Main_Object>)
|
||||
target_compile_definitions(${GENERIC_TARGET_ONLY_COMPRESSED_EXE} PRIVATE GENERIC_COMPRESSED NO_GENERIC_TARGET_ONLY_TEST)
|
||||
target_compile_options(${GENERIC_TARGET_ONLY_COMPRESSED_EXE} PUBLIC --offload-compress -w ${OFFLOAD_ARCH_GENERIC_STR})
|
||||
target_link_libraries(${GENERIC_TARGET_ONLY_COMPRESSED_EXE} hip::host hip::device)
|
||||
if(NOT USE_PREBUILT_CATCH)
|
||||
target_link_libraries(${GENERIC_TARGET_ONLY_COMPRESSED_EXE} Catch2::Catch2WithMain)
|
||||
endif()
|
||||
if (WIN32)
|
||||
set(GENERIC_TARGET_ONLY_EXE ${GENERIC_TARGET_ONLY_EXE}.exe)
|
||||
set(GENERIC_TARGET_ONLY_COMPRESSED_EXE ${GENERIC_TARGET_ONLY_COMPRESSED_EXE}.exe)
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/${GENERIC_TARGET_ONLY_EXE})
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/${GENERIC_TARGET_ONLY_COMPRESSED_EXE})
|
||||
else()
|
||||
@@ -77,12 +79,14 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME hipSquareGenericTarget
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
set_target_properties(hipSquareGenericTarget PROPERTIES COMPILE_FLAGS "-mcode-object-version=6 ${DISABLE_GENERIC_TARGET_ONLY} -w ${OFFLOAD_ARCH_GENERIC_STR}")
|
||||
set_target_properties(hipSquareGenericTarget PROPERTIES COMPILE_FLAGS "-mcode-object-version=6 ${DISABLE_GENERIC_TARGET_ONLY}")
|
||||
target_compile_options(hipSquareGenericTarget PUBLIC ${OFFLOAD_ARCH_GENERIC_STR})
|
||||
|
||||
hip_add_exe_to_target(NAME hipSquareGenericTargetCompressed
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
set_target_properties(hipSquareGenericTargetCompressed PROPERTIES COMPILE_FLAGS " -DGENERIC_COMPRESSED ${DISABLE_GENERIC_TARGET_ONLY} -mcode-object-version=6 --offload-compress -w ${OFFLOAD_ARCH_GENERIC_STR}")
|
||||
set_target_properties(hipSquareGenericTargetCompressed PROPERTIES COMPILE_FLAGS " -DGENERIC_COMPRESSED ${DISABLE_GENERIC_TARGET_ONLY} -mcode-object-version=6 --offload-compress")
|
||||
target_compile_options(hipSquareGenericTargetCompressed PUBLIC ${OFFLOAD_ARCH_GENERIC_STR})
|
||||
|
||||
add_dependencies(hipSquareGenericTarget hipSquareGenericTargetCompressed)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
@@ -93,15 +97,15 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
# SWDEV-548807 skip building hipSpirvTest
|
||||
if(false)
|
||||
add_custom_target(hipSpirvTest ALL
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/hipSpirvTest.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/hip_test_context.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/main.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/hipSpirvTest.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/hip_test_context.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/../../hipTestMain/main.cc
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../external/Catch2
|
||||
-I${Catch2_SOURCE_DIR}/src
|
||||
-I${Catch2_BINARY_DIR}/generated-includes
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../external/picojson
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH} --offload-arch=amdgcnspirv
|
||||
--offload-arch=amdgcnspirv
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/compiler/hipSpirvTest)
|
||||
add_dependencies(CompilerTest hipSpirvTest)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -99,17 +99,17 @@ TEST_CASE("Unit_test_generic_target_in_regular_fatbin") {
|
||||
#ifdef GENERIC_COMPRESSED
|
||||
TEST_CASE("Unit_test_generic_target_only_in_compressed_fatbin") {
|
||||
#ifdef __linux__
|
||||
char* cmd =
|
||||
const char* cmd =
|
||||
"chmod u+x ./hipSquareGenericTargetOnlyCompressed && ./hipSquareGenericTargetOnlyCompressed";
|
||||
#else
|
||||
char* cmd = "hipSquareGenericTargetOnlyCompressed.exe";
|
||||
const char* cmd = "hipSquareGenericTargetOnlyCompressed.exe";
|
||||
#endif
|
||||
#else // else GENERIC_COMPRESSED
|
||||
TEST_CASE("Unit_test_generic_target_only_in_regular_fatbin ") {
|
||||
TEST_CASE("Unit_test_generic_target_only_in_regular_fatbin") {
|
||||
#ifdef __linux__
|
||||
char* cmd = "chmod u+x ./hipSquareGenericTargetOnly && ./hipSquareGenericTargetOnly";
|
||||
const char* cmd = "chmod u+x ./hipSquareGenericTargetOnly && ./hipSquareGenericTargetOnly";
|
||||
#else
|
||||
char* cmd = "hipSquareGenericTargetOnly.exe";
|
||||
const char* cmd = "hipSquareGenericTargetOnly.exe";
|
||||
#endif
|
||||
#endif // GENERIC_COMPRESSED
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ set(TEST_SRC
|
||||
if(HIP_PLATFORM MATCHES "nvidia")
|
||||
set(LINKER_LIBS nvrtc)
|
||||
elseif(HIP_PLATFORM MATCHES "amd")
|
||||
set(LINKER_LIBS hiprtc)
|
||||
set(LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
hip_add_exe_to_target(NAME ComplexTest
|
||||
|
||||
@@ -69,6 +69,6 @@ __global__ void CastComplexTypeKernel(T1* const output_val, T2 const input_val)
|
||||
|
||||
template <typename T> void CompareValues(T actual_val, T ref_val, double margin) {
|
||||
if (!std::isnan(ref_val)) {
|
||||
REQUIRE_THAT(actual_val, Catch::WithinAbs(ref_val, margin));
|
||||
REQUIRE_THAT(actual_val, Catch::Matchers::WithinAbs(ref_val, margin));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ THE SOFTWARE.
|
||||
#include "cooperative_groups_common.hh"
|
||||
#include "cg_common_kernels.hh"
|
||||
|
||||
#include <random>
|
||||
|
||||
#include <cmd_options.hh>
|
||||
#include <cpu_grid.h>
|
||||
#include <resource_guards.hh>
|
||||
|
||||
@@ -20,6 +20,7 @@ THE SOFTWARE.
|
||||
#include "cooperative_groups_common.hh"
|
||||
#include "cg_common_kernels.hh"
|
||||
|
||||
#include <random>
|
||||
#include <bitset>
|
||||
#include <optional>
|
||||
#include <resource_guards.hh>
|
||||
|
||||
@@ -24,6 +24,7 @@ THE SOFTWARE.
|
||||
#include <optional>
|
||||
#include <resource_guards.hh>
|
||||
#include <utils.hh>
|
||||
#include <random>
|
||||
|
||||
#include <cmd_options.hh>
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ THE SOFTWARE.
|
||||
#include "cooperative_groups_common.hh"
|
||||
#include "cg_common_kernels.hh"
|
||||
|
||||
#include <bitset>
|
||||
#include <array>
|
||||
#include <random>
|
||||
|
||||
#include <cmd_options.hh>
|
||||
#include <cpu_grid.h>
|
||||
|
||||
@@ -49,28 +49,53 @@ if(UNIX)
|
||||
)
|
||||
endif()
|
||||
|
||||
set_source_files_properties(hipGetDeviceCount.cc PROPERTIES COMPILE_FLAGS -std=c++17)
|
||||
set_source_files_properties(hipDeviceGetUuid.cc PROPERTIES COMPILE_FLAGS -std=c++17)
|
||||
|
||||
add_executable(getDeviceCount EXCLUDE_FROM_ALL getDeviceCount_exe.cc)
|
||||
set_source_files_properties(getDeviceCount_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(getDeviceCount PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(getDeviceCount hip::host hip::device)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS getDeviceCount)
|
||||
|
||||
add_executable(chkUUIDFrmChildProc_Exe EXCLUDE_FROM_ALL chkUUIDFrmChildProc_Exe.cc)
|
||||
add_executable(chkUUIDInGrandChild_Exe EXCLUDE_FROM_ALL chkUUIDInGrandChild_Exe.cc)
|
||||
add_executable(setuuidGetDevCount EXCLUDE_FROM_ALL setuuidGetDevCount_Exe.cc)
|
||||
|
||||
set_source_files_properties(chkUUIDFrmChildProc_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(chkUUIDInGrandChild_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(setuuidGetDevCount_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(chkUUIDFrmChildProc_Exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(chkUUIDInGrandChild_Exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(setuuidGetDevCount PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(chkUUIDFrmChildProc_Exe hip::host hip::device)
|
||||
target_link_libraries(chkUUIDInGrandChild_Exe hip::host hip::device)
|
||||
target_link_libraries(setuuidGetDevCount hip::host hip::device)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS
|
||||
chkUUIDFrmChildProc_Exe
|
||||
chkUUIDInGrandChild_Exe
|
||||
setuuidGetDevCount)
|
||||
|
||||
if(UNIX)
|
||||
add_executable(getUUIDfrmRocinfo EXCLUDE_FROM_ALL getUUIDfrmRocinfo_Exe.cc)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS getUUIDfrmRocinfo)
|
||||
add_dependencies(build_tests getUUIDfrmRocinfo)
|
||||
add_executable(getUUIDfrmRocinfo EXCLUDE_FROM_ALL getUUIDfrmRocinfo_Exe.cc)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS getUUIDfrmRocinfo)
|
||||
add_dependencies(build_tests getUUIDfrmRocinfo)
|
||||
set_source_files_properties(getUUIDfrmRocinfo_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(getUUIDfrmRocinfo PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(getUUIDfrmRocinfo hip::host hip::device)
|
||||
endif()
|
||||
add_executable(multipleUUID EXCLUDE_FROM_ALL multipleUUID_Exe.cc)
|
||||
add_executable(setEnvInChildProc EXCLUDE_FROM_ALL setEnvInChildProc_Exe.cc)
|
||||
add_executable(uuidList EXCLUDE_FROM_ALL uuidList.cc)
|
||||
|
||||
set_source_files_properties(multipleUUID_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(setEnvInChildProc_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(uuidList.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(multipleUUID PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(setEnvInChildProc PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(uuidList PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(multipleUUID hip::host hip::device)
|
||||
target_link_libraries(setEnvInChildProc hip::host hip::device)
|
||||
target_link_libraries(uuidList hip::host hip::device)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS
|
||||
multipleUUID
|
||||
setEnvInChildProc
|
||||
@@ -85,8 +110,7 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS
|
||||
endif()
|
||||
hip_add_exe_to_target(NAME DeviceTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
TEST_TARGET_NAME build_tests)
|
||||
add_dependencies(build_tests getDeviceCount chkUUIDFrmChildProc_Exe chkUUIDInGrandChild_Exe setuuidGetDevCount multipleUUID setEnvInChildProc uuidList)
|
||||
#Disabled below two executable due to the defect ticket SWDEV-467665
|
||||
if(0)
|
||||
@@ -97,4 +121,7 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
add_executable(hipDeviceSetGetScratchExe EXCLUDE_FROM_ALL hipDeviceSetGetScratchExe.cc)
|
||||
add_dependencies(DeviceTest hipDeviceSetGetScratchExe)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipDeviceSetGetScratchExe)
|
||||
set_source_files_properties(hipDeviceSetGetScratchExe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(hipDeviceSetGetScratchExe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(hipDeviceSetGetScratchExe hip::host hip::device)
|
||||
endif()
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
#define HIP_CHECK(error) \
|
||||
{ \
|
||||
|
||||
@@ -186,7 +186,7 @@ bool verifyAdd_divValue(T* gpuData, int len, bool* activeLanes, T* divergentValu
|
||||
if (activeLanes[i]) val += divergentValue[i];
|
||||
}
|
||||
if (std::is_same<T, float>::value) {
|
||||
REQUIRE(val == Approx(gpuData[0]));
|
||||
REQUIRE(val == Catch::Approx(gpuData[0]));
|
||||
return true;
|
||||
}
|
||||
return val == gpuData[0];
|
||||
@@ -199,7 +199,7 @@ bool verifySub_divValue(T* gpuData, int len, bool* activeLanes, T* divergentValu
|
||||
if (activeLanes[i]) val -= divergentValue[i];
|
||||
}
|
||||
if (std::is_same<T, float>::value) {
|
||||
REQUIRE(val == Approx(gpuData[1]));
|
||||
REQUIRE(val == Catch::Approx(gpuData[1]));
|
||||
return true;
|
||||
}
|
||||
return val == gpuData[1];
|
||||
@@ -213,7 +213,7 @@ bool verifyMax_divValue(T* gpuData, int len, bool* activeLanes, T* divergentValu
|
||||
}
|
||||
|
||||
if (std::is_same<T, float>::value) {
|
||||
REQUIRE(val == Approx(gpuData[2]));
|
||||
REQUIRE(val == Catch::Approx(gpuData[2]));
|
||||
return true;
|
||||
}
|
||||
return val == gpuData[2];
|
||||
@@ -227,7 +227,7 @@ bool verifyMin_divValue(T* gpuData, int len, bool* activeLanes, T* divergentValu
|
||||
}
|
||||
|
||||
if (std::is_same<T, float>::value) {
|
||||
REQUIRE(val == Approx(gpuData[3]));
|
||||
REQUIRE(val == Catch::Approx(gpuData[3]));
|
||||
return true;
|
||||
}
|
||||
return val == gpuData[3];
|
||||
|
||||
@@ -85,7 +85,7 @@ set(AMD_TEST_SRC
|
||||
AtomicsWithRandomActiveLanesInWavefront.cc
|
||||
fp16_ops.cc
|
||||
fp8_host.cc
|
||||
fp8_e8m0.cc
|
||||
# fp8_e8m0.cc # TODO, reenable it, disabling this test due to failure seen on TheRock,
|
||||
fp6_ocp.cc
|
||||
fp4_ocp.cc
|
||||
)
|
||||
@@ -120,29 +120,29 @@ set(AMD_GFX1200_SPEC_TEST_SRC
|
||||
# Note to pass arch use format like -DOFFLOAD_ARCH_STR="--offload-arch=gfx900 --offload-arch=gfx906"
|
||||
# having space at the start/end of OFFLOAD_ARCH_STR can cause build failures
|
||||
add_custom_target(kerDevAllocMultCO.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocMultCO.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocMultCO.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevAllocMultCO.code
|
||||
-I${HIP_PATH}/include/
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
-I${HIP_INCLUDE_DIR}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
add_custom_target(kerDevWriteMultCO.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kerDevWriteMultCO.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevWriteMultCO.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevWriteMultCO.code
|
||||
-I${HIP_PATH}/include/
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
-I${HIP_INCLUDE_DIR}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
add_custom_target(kerDevFreeMultCO.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kerDevFreeMultCO.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevFreeMultCO.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevFreeMultCO.code
|
||||
-I${HIP_PATH}/include/
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
-I${HIP_INCLUDE_DIR}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
add_custom_target(kerDevAllocSingleKer.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocSingleKer.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocSingleKer.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevAllocSingleKer.code
|
||||
-I${HIP_PATH}/include/
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
-I${HIP_INCLUDE_DIR}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/kerDevAllocSingleKer.code)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/kerDevFreeMultCO.code)
|
||||
@@ -185,7 +185,6 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
set(ARCH_GFX1200 -1)
|
||||
endif()
|
||||
set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC})
|
||||
set_source_files_properties(floatTM.cc PROPERTIES COMPILE_FLAGS -std=c++17)
|
||||
set_source_files_properties(bfloat16.cc PROPERTIES COMPILE_FLAGS "-DHIP_ENABLE_WARP_SYNC_BUILTINS")
|
||||
if(${ARCH_CHECK} GREATER_EQUAL 0)
|
||||
set(TEST_SRC ${TEST_SRC} ${AMD_ARCH_SPEC_TEST_SRC})
|
||||
@@ -212,7 +211,7 @@ endif()
|
||||
hip_add_exe_to_target(NAME UnitDeviceTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
elseif(HIP_PLATFORM MATCHES "nvidia")
|
||||
hip_add_exe_to_target(NAME UnitDeviceTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
@@ -220,4 +219,4 @@ elseif(HIP_PLATFORM MATCHES "nvidia")
|
||||
COMPILE_OPTIONS --Wno-deprecated-declarations)
|
||||
endif()
|
||||
|
||||
add_dependencies(build_tests kerDevAllocMultCO.code kerDevWriteMultCO.code kerDevFreeMultCO.code kerDevAllocSingleKer.code)
|
||||
add_dependencies(UnitDeviceTests kerDevAllocMultCO.code kerDevWriteMultCO.code kerDevFreeMultCO.code kerDevAllocSingleKer.code)
|
||||
|
||||
@@ -73,7 +73,7 @@ void fp16_arith_cpu(const std::vector<float>& a, const std::vector<float>& b,
|
||||
TEST_CASE("Unit_fp16_arith") {
|
||||
constexpr size_t num_of_ops = 18;
|
||||
constexpr size_t iters = 100;
|
||||
Catch::Generators::RandomFloatingGenerator<float> input1_gen(2.2f, 10.f);
|
||||
Catch::Generators::RandomFloatingGenerator<float> input1_gen(2.2f, 10.f, /*seed*/ 0x1234);
|
||||
constexpr float input2 = 1.1f;
|
||||
for (size_t iter = 0; iter < iters; iter++) {
|
||||
auto input1 = input1_gen.get();
|
||||
@@ -98,7 +98,7 @@ TEST_CASE("Unit_fp16_arith") {
|
||||
for (size_t i = 0; i < out.size(); i++) {
|
||||
INFO("Iter: " << i << " In1: " << in1[i] << " CPU res: " << cpuout[i]
|
||||
<< " GPU res: " << out[i]);
|
||||
REQUIRE(out[i] == Approx(cpuout[i]).epsilon(0.1));
|
||||
REQUIRE(out[i] == Catch::Approx(cpuout[i]).epsilon(0.1));
|
||||
}
|
||||
HIP_CHECK(hipFree(dout));
|
||||
HIP_CHECK(hipFree(din1));
|
||||
@@ -153,7 +153,7 @@ void fp162_arith_cpu(std::vector<float2>& a, std::vector<float2>& b, std::vector
|
||||
TEST_CASE("Unit_fp162_arith") {
|
||||
constexpr size_t num_of_ops = 18;
|
||||
constexpr size_t iters = 100;
|
||||
Catch::Generators::RandomFloatingGenerator<float> input1_gen(2.2f, 10.f);
|
||||
Catch::Generators::RandomFloatingGenerator<float> input1_gen(2.2f, 10.f, /* seed */ 0x1234);
|
||||
for (size_t iter = 0; iter < iters; iter++) {
|
||||
auto input1 = input1_gen.get();
|
||||
auto input2 = input1_gen.get();
|
||||
@@ -178,8 +178,8 @@ TEST_CASE("Unit_fp162_arith") {
|
||||
for (size_t i = 0; i < out.size(); i++) {
|
||||
INFO("Iter: " << i << " In1: " << in1[i].x << " - " << in1[i].y << " CPU res: " << cpuout[i].x
|
||||
<< " - " << cpuout[i].y << " GPU res: " << out[i].x << " - " << out[i].y);
|
||||
REQUIRE(out[i].x == Approx(cpuout[i].x).epsilon(0.1));
|
||||
REQUIRE(out[i].y == Approx(cpuout[i].y).epsilon(0.1));
|
||||
REQUIRE(out[i].x == Catch::Approx(cpuout[i].x).epsilon(0.1));
|
||||
REQUIRE(out[i].y == Catch::Approx(cpuout[i].y).epsilon(0.1));
|
||||
}
|
||||
HIP_CHECK(hipFree(dout));
|
||||
HIP_CHECK(hipFree(din1));
|
||||
|
||||
@@ -786,7 +786,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness_device", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt2 == cvt1);
|
||||
}
|
||||
|
||||
@@ -1086,7 +1086,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness_device", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt2 == cvt1);
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt2 == cvt1);
|
||||
}
|
||||
}
|
||||
@@ -447,7 +447,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt1 == cvt2);
|
||||
}
|
||||
}
|
||||
@@ -787,7 +787,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt2 == cvt1);
|
||||
}
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt1 == cvt2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,7 +752,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness_device", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt2 == cvt1);
|
||||
}
|
||||
|
||||
@@ -1044,7 +1044,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness_device", "", float, double) {
|
||||
|
||||
INFO("Original: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&orig)));
|
||||
INFO("Cvt back: " << std::bitset<32>(*reinterpret_cast<const unsigned int*>(&cvt1)));
|
||||
REQUIRE(cvt1 == Approx(orig));
|
||||
REQUIRE(cvt1 == Catch::Approx(orig));
|
||||
REQUIRE(cvt2 == cvt1);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,41 +92,41 @@ template <typename V> bool TestVectorType() {
|
||||
V f1 = MakeVector<V>(1);
|
||||
V f2 = MakeVector<V>(1);
|
||||
V f3 = f1 + f2;
|
||||
REQUIRE(f3 == v2);
|
||||
REQUIRE((f3 == v2));
|
||||
f2 = f3 - f1;
|
||||
REQUIRE(f2 == v1);
|
||||
REQUIRE((f2 == v1));
|
||||
f1 = f2 * f3;
|
||||
REQUIRE(f1 == v2);
|
||||
REQUIRE((f1 == v2));
|
||||
f2 = f1 / f3;
|
||||
REQUIRE(f2 == v1);
|
||||
REQUIRE((f2 == v1));
|
||||
integer_binary_tests(f1, f2, f3);
|
||||
|
||||
f1 = MakeVector<V>(2);
|
||||
f2 = MakeVector<V>(1);
|
||||
f1 += f2;
|
||||
REQUIRE(f1 == v3);
|
||||
REQUIRE((f1 == v3));
|
||||
f1 -= f2;
|
||||
REQUIRE(f1 == v2);
|
||||
REQUIRE((f1 == v2));
|
||||
f1 *= f2;
|
||||
REQUIRE(f1 == v2);
|
||||
REQUIRE((f1 == v2));
|
||||
f1 /= f2;
|
||||
REQUIRE(f1 == v2);
|
||||
REQUIRE((f1 == v2));
|
||||
|
||||
integer_unary_tests(f1, f2);
|
||||
|
||||
f1 = v2;
|
||||
f2 = f1++;
|
||||
REQUIRE(f1 == v3);
|
||||
REQUIRE(f2 == v2);
|
||||
REQUIRE((f1 == v3));
|
||||
REQUIRE((f2 == v2));
|
||||
f2 = f1--;
|
||||
REQUIRE(f2 == v3);
|
||||
REQUIRE(f1 == v2);
|
||||
REQUIRE((f2 == v3));
|
||||
REQUIRE((f1 == v2));
|
||||
f2 = ++f1;
|
||||
REQUIRE(f1 == v3);
|
||||
REQUIRE(f2 == v3);
|
||||
REQUIRE((f1 == v3));
|
||||
REQUIRE((f2 == v3));
|
||||
f2 = --f1;
|
||||
REQUIRE(f1 == v2);
|
||||
REQUIRE(f2 == v2);
|
||||
REQUIRE((f1 == v2));
|
||||
REQUIRE((f2 == v2));
|
||||
|
||||
REQUIRE(constructor_tests<V>() == true);
|
||||
|
||||
@@ -134,7 +134,7 @@ template <typename V> bool TestVectorType() {
|
||||
f2 = v4;
|
||||
f3 = v3;
|
||||
REQUIRE(!(f1 == f2));
|
||||
REQUIRE(f1 != f2);
|
||||
REQUIRE((f1 != f2));
|
||||
|
||||
using T = typename V::value_type;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "./defs.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "./defs.h"
|
||||
/**
|
||||
* This kernel allocates and deallocates memory in every thread.
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "./defs.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "./defs.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ set(TEST_SRC
|
||||
if(HIP_PLATFORM MATCHES "nvidia")
|
||||
set(LINKER_LIBS nvrtc)
|
||||
elseif(HIP_PLATFORM MATCHES "amd")
|
||||
set(LINKER_LIBS hiprtc)
|
||||
set(LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
@@ -41,8 +41,7 @@ elseif (HIP_PLATFORM MATCHES "nvidia")
|
||||
hip_add_exe_to_target(NAME DeviceMemoryTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS ${LINKER_LIBS}
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
LINKER_LIBS ${LINKER_LIBS})
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -63,4 +62,4 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC})
|
||||
# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# memset_negative_kernels.cc 4)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -32,12 +32,21 @@ hip_add_exe_to_target(NAME dynamicLoading
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
add_custom_target(libLazyLoad.so COMMAND ${CMAKE_CXX_COMPILER} -fPIC -lpthread -shared ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${CMAKE_CURRENT_SOURCE_DIR}/../../external/Catch2 -L${HIP_PATH}/${CMAKE_INSTALL_LIBDIR} --hip-path=${HIP_PATH} -o libLazyLoad.so)
|
||||
add_custom_target(libLazyLoad.so COMMAND ${CMAKE_HIP_COMPILER} -fPIC -lpthread -shared
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}
|
||||
-I${Catch2_SOURCE_DIR}/src -I${Catch2_BINARY_DIR}/generated-includes
|
||||
-o libLazyLoad.so)
|
||||
elseif(HIP_PLATFORM MATCHES "nvidia")
|
||||
add_custom_target(libLazyLoad.so COMMAND ${CMAKE_CXX_COMPILER} -Xcompiler -fPIC -lpthread -Wno-deprecated-declarations -shared ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${CMAKE_CURRENT_SOURCE_DIR}/../../external/Catch2 -I${HIP_PATH}/include/ -o libLazyLoad.so)
|
||||
add_custom_target(libLazyLoad.so COMMAND ${CMAKE_CUDA_COMPILER} -Xcompiler -fPIC -lpthread -Wno-deprecated-declarations -shared
|
||||
-x cu ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc -I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
-I${Catch2_SOURCE_DIR}/src -I${Catch2_BINARY_DIR}/generated-includes -I${HIP_PATH}/include/ -o libLazyLoad.so)
|
||||
endif()
|
||||
|
||||
add_custom_target(bit_extract_kernel.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/bit_extract_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/bit_extract_kernel.code -I${HIP_PATH}/include/ -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH} -L${HIP_PATH}/${CMAKE_INSTALL_LIBDIR})
|
||||
add_custom_target(bit_extract_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/bit_extract_kernel.cpp ${HIP_PATH_OPT}
|
||||
${OFFLOAD_ARCH_LIST} -o ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/bit_extract_kernel.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
|
||||
add_custom_target(vecadd.cc COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/vecadd.cc ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
@@ -47,10 +56,10 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME Dynamic
|
||||
TEST_SRC ${LINUX_TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS ${CMAKE_DL_LIBS})
|
||||
hip_add_exe_to_target(NAME Dynamic
|
||||
TEST_SRC ${LINUX_TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
add_dependencies(build_tests bit_extract_kernel.code libLazyLoad.so vecadd.cc)
|
||||
endif()
|
||||
|
||||
@@ -32,8 +32,8 @@ THE SOFTWARE.
|
||||
}
|
||||
|
||||
__global__ static void addition(float* C, float* A, float* B, size_t N) {
|
||||
size_t offset = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x;
|
||||
size_t stride = hipBlockDim_x * hipGridDim_x;
|
||||
size_t offset = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
size_t stride = blockDim.x * gridDim.x;
|
||||
|
||||
for (size_t i = offset; i < N; i += stride) {
|
||||
C[i] = A[i] + B[i];
|
||||
@@ -121,7 +121,9 @@ __global__ static void test_gws(uint* buf, uint bufSize, int64_t* tmpBuf, int64_
|
||||
tmpBuf[blockIdx.x] = sum;
|
||||
}
|
||||
|
||||
gg.sync();
|
||||
// TODO: remove syncthreads with grid sync when compiler issue is fixed
|
||||
// gg.sync();
|
||||
__syncthreads();
|
||||
|
||||
if (offset == 0) {
|
||||
for (uint i = 1; i < gridDim.x; ++i) {
|
||||
|
||||
@@ -17,6 +17,14 @@ endif()
|
||||
|
||||
add_executable(hipGetLastErrorEnv_Exe EXCLUDE_FROM_ALL hipGetLastErrorEnv_Exe.cc)
|
||||
add_executable(hipPeekAtLastErrorEnv_Exe EXCLUDE_FROM_ALL hipPeekAtLastErrorEnv_Exe.cc)
|
||||
|
||||
set_source_files_properties(hipGetLastErrorEnv_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(hipPeekAtLastErrorEnv_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(hipGetLastErrorEnv_Exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(hipPeekAtLastErrorEnv_Exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(hipGetLastErrorEnv_Exe hip::host hip::device)
|
||||
target_link_libraries(hipPeekAtLastErrorEnv_Exe hip::host hip::device)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
set(AMD_SRC
|
||||
hipExtGetLastError.cc
|
||||
@@ -25,8 +33,7 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
endif()
|
||||
hip_add_exe_to_target(NAME ErrorHandlingTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
add_dependencies(ErrorHandlingTest hipGetLastErrorEnv_Exe hipPeekAtLastErrorEnv_Exe)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipGetLastErrorEnv_Exe hipPeekAtLastErrorEnv_Exe)
|
||||
|
||||
@@ -74,9 +74,9 @@ TEST_CASE("Unit_hipGetErrorName_Negative_Parameters") {
|
||||
const char* error_string = hipGetErrorName(static_cast<hipError_t>(-1));
|
||||
REQUIRE(error_string != nullptr);
|
||||
#if HT_NVIDIA
|
||||
REQUIRE_THAT(error_string, Catch::Equals("cudaErrorUnknown"));
|
||||
REQUIRE_THAT(error_string, Catch::Matchers::Equals("cudaErrorUnknown"));
|
||||
#elif HT_AMD
|
||||
REQUIRE_THAT(error_string, Catch::Equals("hipErrorUnknown"));
|
||||
REQUIRE_THAT(error_string, Catch::Matchers::Equals("hipErrorUnknown"));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -24,5 +24,4 @@ endif()
|
||||
|
||||
hip_add_exe_to_target(NAME ExecutionControlTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
# AMD specific test
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
if(UNIX)
|
||||
set(TEST_SRC
|
||||
hipMalloc.cc
|
||||
)
|
||||
# Creating Custom object file
|
||||
add_custom_target(malloc_custom COMMAND g++ -c ${CMAKE_CURRENT_SOURCE_DIR}/hipMalloc.cpp -I${HIP_PATH}/include -D__HIP_PLATFORM_AMD__ -o malloc.o BYPRODUCTS malloc.o)
|
||||
add_library(malloc_gpp OBJECT IMPORTED)
|
||||
set_property(TARGET malloc_gpp PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/malloc.o")
|
||||
if(HIP_PLATFORM MATCHES "amd" AND UNIX AND GPP_EXEC)
|
||||
set(TEST_SRC
|
||||
hipMalloc.cc
|
||||
)
|
||||
|
||||
hip_add_exe_to_target(NAME gppTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS malloc_gpp)
|
||||
add_custom_target(malloc_custom COMMAND ${GPP_EXEC} -c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hipMalloc.cpp -I${HIP_INCLUDE_DIR}
|
||||
-D__HIP_PLATFORM_AMD__ -o malloc.o BYPRODUCTS malloc.o)
|
||||
add_library(malloc_gpp OBJECT IMPORTED)
|
||||
set_property(TARGET malloc_gpp PROPERTY IMPORTED_OBJECTS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/malloc.o")
|
||||
|
||||
add_dependencies(gppTests malloc_custom)
|
||||
endif()
|
||||
hip_add_exe_to_target(NAME gppTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS malloc_gpp)
|
||||
|
||||
add_dependencies(gppTests malloc_custom)
|
||||
endif()
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
# Common Tests - Test independent of all platforms
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
if(UNIX)
|
||||
set(TEST_SRC
|
||||
gccTest.cc
|
||||
gpu.cpp
|
||||
)
|
||||
# Creating Custom object file
|
||||
add_custom_command(OUTPUT LaunchKernel.o COMMAND gcc -c -Wno-deprecated-declarations ${CMAKE_CURRENT_SOURCE_DIR}/LaunchKernel.c -I${HIP_PATH}/include -D__HIP_PLATFORM_AMD__ -o LaunchKernel.o)
|
||||
add_custom_target(LaunchKernel_custom DEPENDS LaunchKernel.o)
|
||||
add_custom_command(OUTPUT hipMalloc.o COMMAND gcc -c -Wno-deprecated-declarations ${CMAKE_CURRENT_SOURCE_DIR}/hipMalloc.c -I${HIP_PATH}/include -D__HIP_PLATFORM_AMD__ -o hipMalloc.o)
|
||||
add_custom_target(hipMalloc_custom DEPENDS hipMalloc.o)
|
||||
if(HIP_PLATFORM MATCHES "amd" AND UNIX AND GCC_EXEC)
|
||||
set(TEST_SRC
|
||||
gccTest.cc
|
||||
gpu.cpp
|
||||
)
|
||||
# Creating Custom object file
|
||||
add_custom_command(OUTPUT LaunchKernel.o COMMAND ${GCC_EXEC} -c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/LaunchKernel.c -Wno-deprecated-declarations -I${HIP_INCLUDE_DIR}
|
||||
-D__HIP_PLATFORM_AMD__ -o LaunchKernel.o)
|
||||
add_custom_target(LaunchKernel_custom DEPENDS LaunchKernel.o)
|
||||
add_custom_command(OUTPUT hipMalloc.o COMMAND ${GCC_EXEC} -c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hipMalloc.c -Wno-deprecated-declarations -I${HIP_INCLUDE_DIR}
|
||||
-D__HIP_PLATFORM_AMD__ -o hipMalloc.o)
|
||||
add_custom_target(hipMalloc_custom DEPENDS hipMalloc.o)
|
||||
|
||||
add_library(LaunchKernel_lib OBJECT IMPORTED)
|
||||
add_library(hipMalloc_lib OBJECT IMPORTED)
|
||||
add_library(LaunchKernel_lib OBJECT IMPORTED)
|
||||
add_library(hipMalloc_lib OBJECT IMPORTED)
|
||||
|
||||
set_property(TARGET LaunchKernel_lib PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/LaunchKernel.o")
|
||||
set_property(TARGET hipMalloc_lib PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/hipMalloc.o")
|
||||
set_property(TARGET LaunchKernel_lib PROPERTY IMPORTED_OBJECTS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/LaunchKernel.o")
|
||||
set_property(TARGET hipMalloc_lib PROPERTY IMPORTED_OBJECTS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/hipMalloc.o")
|
||||
|
||||
|
||||
hip_add_exe_to_target(NAME gccTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS LaunchKernel_lib hipMalloc_lib)
|
||||
hip_add_exe_to_target(NAME gccTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS LaunchKernel_lib hipMalloc_lib)
|
||||
|
||||
add_dependencies(gccTests LaunchKernel_custom hipMalloc_custom)
|
||||
endif()
|
||||
add_dependencies(gccTests LaunchKernel_custom hipMalloc_custom)
|
||||
endif()
|
||||
|
||||
@@ -75,8 +75,7 @@ endif()
|
||||
# Create test executable
|
||||
hip_add_exe_to_target(NAME GLInteropTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
# Link dependencies
|
||||
target_link_libraries(GLInteropTest OpenGL::GL GLUT::GLUT)
|
||||
|
||||
@@ -181,7 +181,11 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
set(TEST_SRC ${TEST_SRC} ${AMD_SRC})
|
||||
endif()
|
||||
|
||||
add_custom_target(add_Kernel.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/add_Kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../graph/add_Kernel.code -I${HIP_PATH}/include/ -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(add_Kernel.code COMMAND ${CMAKE_HIP_COMPILER}
|
||||
--cuda-device-only ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/add_Kernel.cpp
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../graph/add_Kernel.code
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
set_property(GLOBAL APPEND PROPERTY
|
||||
G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/add_Kernel.code)
|
||||
|
||||
@@ -190,7 +194,13 @@ hip_add_exe_to_target(NAME GraphsTest2
|
||||
TEST_TARGET_NAME build_tests)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
add_custom_target(hipMatMul COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/hipMatMul.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/graph/hipMatMul.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../../../include/ -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(hipMatMul COMMAND ${CMAKE_HIP_COMPILER}
|
||||
--cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/hipMatMul.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/graph/hipMatMul.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../../../include/
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
add_dependencies(build_tests hipMatMul)
|
||||
set_property(GLOBAL APPEND PROPERTY
|
||||
G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/hipMatMul.code)
|
||||
|
||||
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
extern "C" __global__ void Add(int* a, int* b, int* c) {
|
||||
size_t tx = (blockIdx.x * blockDim.x + threadIdx.x);
|
||||
c[tx] = a[tx] + b[tx];
|
||||
|
||||
@@ -61,7 +61,7 @@ void MemcpyFromSymbolShell(F f, const void* symbol, size_t offset, const std::ve
|
||||
|
||||
std::vector<T> symbol_values(expected.size());
|
||||
HIP_CHECK(hipMemcpy(symbol_values.data(), dst_alloc.ptr(), size, hipMemcpyDefault));
|
||||
REQUIRE_THAT(expected, Catch::Equals(symbol_values));
|
||||
REQUIRE_THAT(expected, Catch::Matchers::Equals(symbol_values));
|
||||
}
|
||||
|
||||
template <typename T, typename F>
|
||||
@@ -82,7 +82,7 @@ void MemcpyToSymbolShell(F f, const void* symbol, size_t offset, const std::vect
|
||||
|
||||
std::vector<T> symbol_values(set_values.size());
|
||||
HIP_CHECK(hipMemcpyFromSymbol(symbol_values.data(), symbol, size, offset * sizeof(T)));
|
||||
REQUIRE_THAT(set_values, Catch::Equals(symbol_values));
|
||||
REQUIRE_THAT(set_values, Catch::Matchers::Equals(symbol_values));
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
|
||||
@@ -634,7 +634,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetParams") {
|
||||
// Validating hipGraphKernelNodeGetParams API
|
||||
HIP_CHECK(dyn_hipGraphKernelNodeGetParams_ptr(kernelNode, &receivedKernelNodeParams));
|
||||
|
||||
REQUIRE(receivedKernelNodeParams.func == addOneKernel);
|
||||
REQUIRE((receivedKernelNodeParams.func == addOneKernel));
|
||||
REQUIRE(receivedKernelNodeParams.gridDim.x == 1);
|
||||
REQUIRE(receivedKernelNodeParams.gridDim.y == 1);
|
||||
REQUIRE(receivedKernelNodeParams.gridDim.z == 1);
|
||||
@@ -661,7 +661,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetParams") {
|
||||
|
||||
HIP_CHECK(dyn_hipGraphKernelNodeGetParams_ptr(kernelNode, &receivedKernelNodeParams));
|
||||
|
||||
REQUIRE(receivedKernelNodeParams.func == addTwoKernel);
|
||||
REQUIRE((receivedKernelNodeParams.func == addTwoKernel));
|
||||
REQUIRE(receivedKernelNodeParams.gridDim.x == 2);
|
||||
REQUIRE(receivedKernelNodeParams.gridDim.y == 1);
|
||||
REQUIRE(receivedKernelNodeParams.gridDim.z == 1);
|
||||
|
||||
@@ -29,13 +29,14 @@ THE SOFTWARE.
|
||||
#include <hip_test_checkers.hh>
|
||||
#include <hip_test_kernels.hh>
|
||||
|
||||
#include <numeric>
|
||||
|
||||
#define N 1024
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
__device__ int globalIn[N];
|
||||
|
||||
@@ -20,9 +20,9 @@ THE SOFTWARE.
|
||||
/*
|
||||
This code object should be automatically built via "make build_tests".
|
||||
In case it's missing, please type the following to generate it,
|
||||
/opt/rocm/hip/bin/hipcc --genco hipMatMul.cc -o hipMatMul.code
|
||||
/opt/rocm/hip/bin/hipcc --cuda-device-only hipMatMul.cc -o hipMatMul.code
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
__device__ int deviceGlobal = 1;
|
||||
|
||||
extern "C" __global__ void matmulK(int* A, int* B, int* C, int N) {
|
||||
|
||||
@@ -182,7 +182,7 @@ TEST_CASE("Unit_hipStreamCapture_ExtModuleLaunchKernel") {
|
||||
if (stat(GraphModuleLaunchKernel::fileName, &fileStat) || !(fileStat.st_mode & S_IFREG)) {
|
||||
FAIL("module file " << GraphModuleLaunchKernel::fileName << " doesn't exist! aborted! \n"
|
||||
<< "To generate the file, type\n"
|
||||
<< "/opt/rocm/hip/bin/hipcc --genco hipMatMul.cc -o hipMatMul.code");
|
||||
<< "/opt/rocm/hip/bin/hipcc --cuda-device-only hipMatMul.cc -o hipMatMul.code");
|
||||
return;
|
||||
}
|
||||
HIPCHECK(hipSetDevice(0));
|
||||
|
||||
@@ -27,7 +27,7 @@ set(TEST_SRC
|
||||
hip_add_exe_to_target(NAME HipSpecificTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc
|
||||
LINKER_LIBS hiprtc::hiprtc
|
||||
PROPERTY CXX_STANDARD 17)
|
||||
if(UNIX)
|
||||
file(GLOB NEGATIVE_TEST_SRC
|
||||
@@ -40,4 +40,4 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC})
|
||||
# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# hip_hc_8pk_negative_kernels.cc 90)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -31,7 +31,7 @@ elseif(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME LaunchBoundsTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -59,4 +59,4 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC})
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# launch_bounds_parse_error_kernels.cc 0 0)
|
||||
#endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
set(TEST_SRC
|
||||
loadlib_rtc.cc
|
||||
loadlib_co.cc
|
||||
#loadlib_co.cc TODO
|
||||
library_negative.cc
|
||||
)
|
||||
|
||||
add_custom_target(library_code_load.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${CMAKE_CURRENT_SOURCE_DIR}/library_code_load.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../library/library_code_load.code ${OFFLOAD_ARCH_STR}
|
||||
-I${HIP_PATH}/include/ -I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
--rocm-path=${ROCM_PATH})
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/library_code_load.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../library/library_code_load.code ${OFFLOAD_ARCH_LIST}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT})
|
||||
set_property(GLOBAL APPEND PROPERTY
|
||||
G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/library_code_load.code)
|
||||
|
||||
@@ -16,7 +16,7 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME LibraryTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
else()
|
||||
hip_add_exe_to_target(NAME LibraryTests
|
||||
TEST_SRC ${TEST_SRC}
|
||||
|
||||
@@ -46,7 +46,7 @@ elseif(HIP_PLATFORM MATCHES "amd")
|
||||
half_precision_arithmetic.cc
|
||||
half_precision_comparison.cc
|
||||
)
|
||||
set(LINKER_LIBS hiprtc)
|
||||
set(LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
find_package(Boost 1.70.0)
|
||||
@@ -191,4 +191,4 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC})
|
||||
# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# casting_half_float_negative_kernels.cc 18)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -26,6 +26,8 @@ THE SOFTWARE.
|
||||
|
||||
#include <hip/hip_cooperative_groups.h>
|
||||
|
||||
#include <random>
|
||||
|
||||
namespace cg = cooperative_groups;
|
||||
|
||||
#define MATH_UNARY_KERNEL_DEF(func_name) \
|
||||
|
||||
@@ -22,12 +22,13 @@ THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <catch2/matchers/catch_matchers_floating_point.hpp>
|
||||
|
||||
// Define a new MatcherBase class with a public 'describe' member function because
|
||||
// Catch::MatcherBase::describe is protected and thus can't be used via a pointer to
|
||||
// Catch::MatcherBase.
|
||||
template <typename T> class MatcherBase : public Catch::MatcherBase<T> {
|
||||
template <typename T> class MatcherBase : public Catch::Matchers::MatcherBase<T> {
|
||||
public:
|
||||
virtual std::string describe() const = 0;
|
||||
virtual ~MatcherBase() = default;
|
||||
@@ -62,22 +63,22 @@ template <typename T, typename Matcher> class ValidatorBase : public MatcherBase
|
||||
|
||||
template <typename T> auto ULPValidatorBuilderFactory(int64_t ulps) {
|
||||
return [=](T target, auto&&...) {
|
||||
return std::make_unique<ValidatorBase<T, Catch::Matchers::Floating::WithinUlpsMatcher>>(
|
||||
target, Catch::WithinULP(target, ulps));
|
||||
return std::make_unique<ValidatorBase<T, Catch::Matchers::WithinUlpsMatcher>>(
|
||||
target, Catch::Matchers::WithinULP(target, ulps));
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T> auto AbsValidatorBuilderFactory(double margin) {
|
||||
return [=](T target, auto&&...) {
|
||||
return std::make_unique<ValidatorBase<T, Catch::Matchers::Floating::WithinAbsMatcher>>(
|
||||
target, Catch::WithinAbs(target, margin));
|
||||
return std::make_unique<ValidatorBase<T, Catch::Matchers::WithinAbsMatcher>>(
|
||||
target, Catch::Matchers::WithinAbs(target, margin));
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T> auto RelValidatorBuilderFactory(T margin) {
|
||||
return [=](T target, auto&&...) {
|
||||
return std::make_unique<ValidatorBase<T, Catch::Matchers::Floating::WithinRelMatcher>>(
|
||||
target, Catch::WithinRel(target, margin));
|
||||
return std::make_unique<ValidatorBase<T, Catch::Matchers::WithinRelMatcher>>(
|
||||
target, Catch::Matchers::WithinRel(target, margin));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -135,23 +135,29 @@ hip_add_exe_to_target(NAME MemoryTest1
|
||||
|
||||
if(UNIX)
|
||||
# link libnuma for numa_available(), numa_max_node(), move_pages(), etc.
|
||||
find_library(NUMA_LIB numa)
|
||||
if(NUMA_LIB)
|
||||
target_link_libraries(MemoryTest1 ${NUMA_LIB})
|
||||
find_package(NUMA QUIET)
|
||||
if(NUMA_FOUND)
|
||||
set(NUMA "${NUMA_LIBRARIES}")
|
||||
else()
|
||||
message(WARNING "libnuma not found; HostNuma tests will fail to link")
|
||||
find_library(NUMA NAMES numa REQUIRED)
|
||||
endif()
|
||||
target_link_libraries(MemoryTest1 ${NUMA})
|
||||
endif()
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
set_source_files_properties(hipHostRegister.cc PROPERTIES COMPILE_FLAGS -std=c++17)
|
||||
set_source_files_properties(hipHostRegister_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
add_executable(hipHostRegisterPerf EXCLUDE_FROM_ALL hipHostRegister_exe.cc)
|
||||
set_target_properties(hipHostRegisterPerf PROPERTIES LINKER_LANGUAGE HIP)
|
||||
add_dependencies(build_tests hipHostRegisterPerf)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipHostRegisterPerf)
|
||||
target_link_libraries(hipHostRegisterPerf hip::host hip::device)
|
||||
if(UNIX)
|
||||
set_source_files_properties(hipMemAdvise_AlignedAllocMem_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
add_executable(hipMemAdviseTstAlignedAllocMem EXCLUDE_FROM_ALL hipMemAdvise_AlignedAllocMem_Exe.cc)
|
||||
set_target_properties(hipMemAdviseTstAlignedAllocMem PROPERTIES LINKER_LANGUAGE HIP)
|
||||
add_dependencies(MemoryTest1 hipMemAdviseTstAlignedAllocMem)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipMemAdviseTstAlignedAllocMem)
|
||||
target_link_libraries(hipMemAdviseTstAlignedAllocMem hip::host hip::device)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -277,12 +283,12 @@ set(TEST_SRC
|
||||
memoryCommon.cc
|
||||
)
|
||||
|
||||
hip_add_exe_to_target(NAME InlineVarTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
|
||||
set_target_properties(InlineVarTest PROPERTIES COMPILE_FLAGS -fgpu-rdc)
|
||||
set_target_properties(InlineVarTest PROPERTIES LINK_FLAGS -fgpu-rdc)
|
||||
#hip_add_exe_to_target(NAME InlineVarTest
|
||||
# TEST_SRC ${TEST_SRC}
|
||||
# TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
#
|
||||
# set_target_properties(InlineVarTest PROPERTIES COMPILE_FLAGS -fgpu-rdc)
|
||||
# set_target_properties(InlineVarTest PROPERTIES LINK_FLAGS -fgpu-rdc)
|
||||
endif()
|
||||
|
||||
set(TEST_SRC
|
||||
|
||||
@@ -335,7 +335,7 @@ TEST_CASE("Unit_hipArrayCreate_BadNumberChannelElement") {
|
||||
hipArray_t array;
|
||||
|
||||
INFO("Format: " << formatToString(desc.Format) << " NumChannels: " << desc.NumChannels
|
||||
<< " Height: " << desc.Height)
|
||||
<< " Height: " << desc.Height);
|
||||
HIP_CHECK_ERROR(hipArrayCreate(&array, &desc), hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
@@ -360,6 +360,6 @@ TEST_CASE("Unit_hipArrayCreate_BadChannelFormat") {
|
||||
|
||||
hipArray_t array;
|
||||
|
||||
INFO("Format: " << formatToString(desc.Format) << " Height: " << desc.Height)
|
||||
INFO("Format: " << formatToString(desc.Format) << " Height: " << desc.Height);
|
||||
HIP_CHECK_ERROR(hipArrayCreate(&array, &desc), hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
@@ -679,6 +679,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisArrayRelated") {
|
||||
desc3d.Width = 8;
|
||||
desc3d.Height = 4;
|
||||
desc3d.Depth = 2;
|
||||
desc3d.Flags = 0;
|
||||
|
||||
HIP_CHECK(hipArray3DCreate(&array3d, &desc3d));
|
||||
HIP_CHECK(dyn_hipArray3DCreate_ptr(&array3d_ptr, &desc3d));
|
||||
@@ -715,6 +716,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisArrayRelated") {
|
||||
gd_desc3d.Width = 16;
|
||||
gd_desc3d.Height = 4;
|
||||
gd_desc3d.Depth = 8;
|
||||
gd_desc3d.Flags = 0;
|
||||
|
||||
HIP_CHECK(hipArray3DCreate(&gd_array3d, &gd_desc3d));
|
||||
HIP_CHECK(hipArray3DCreate(&gd_array3d_ptr, &gd_desc3d));
|
||||
|
||||
@@ -27,6 +27,7 @@ THE SOFTWARE.
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include <random>
|
||||
#include <hip_test_checkers.hh>
|
||||
#include <hip_test_kernels.hh>
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
|
||||
@@ -23,7 +23,7 @@ THE SOFTWARE.
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include "hip/hip_runtime_api.h"
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
#define HIP_CHECK(error) \
|
||||
{ \
|
||||
|
||||
@@ -97,37 +97,37 @@ void checkMemset(T value, size_t count, MemsetType memsetType, bool async = fals
|
||||
switch (memsetType) {
|
||||
case hipMemsetTypeDefault:
|
||||
if (!async) {
|
||||
INFO("Testing hipMemset call")
|
||||
INFO("Testing hipMemset call");
|
||||
HIP_MEMSET_CHECK(hipMemset, devPtr, value, count, false);
|
||||
} else {
|
||||
INFO("Testing hipMemsetAsync call")
|
||||
INFO("Testing hipMemsetAsync call");
|
||||
HIP_MEMSET_CHECK(hipMemsetAsync, devPtr, value, count, true);
|
||||
}
|
||||
break;
|
||||
case hipMemsetTypeD8:
|
||||
if (!async) {
|
||||
INFO("Testing hipMemsetD8 call")
|
||||
INFO("Testing hipMemsetD8 call");
|
||||
HIP_MEMSET_CHECK_DTYPE(hipMemsetD8, devPtr, value, count, false);
|
||||
} else {
|
||||
INFO("Testing hipMemsetD8Async call")
|
||||
INFO("Testing hipMemsetD8Async call");
|
||||
HIP_MEMSET_CHECK_DTYPE(hipMemsetD8Async, devPtr, value, count, true);
|
||||
}
|
||||
break;
|
||||
case hipMemsetTypeD16:
|
||||
if (!async) {
|
||||
INFO("Testing hipMemsetD16 call")
|
||||
INFO("Testing hipMemsetD16 call");
|
||||
HIP_MEMSET_CHECK_DTYPE(hipMemsetD16, devPtr, value, count, false);
|
||||
} else {
|
||||
INFO("Testing hipMemsetD16Async call")
|
||||
INFO("Testing hipMemsetD16Async call");
|
||||
HIP_MEMSET_CHECK_DTYPE(hipMemsetD16Async, devPtr, value, count, true);
|
||||
}
|
||||
break;
|
||||
case hipMemsetTypeD32:
|
||||
if (!async) {
|
||||
INFO("Testing hipMemsetD32 call")
|
||||
INFO("Testing hipMemsetD32 call");
|
||||
HIP_MEMSET_CHECK_DTYPE(hipMemsetD32, devPtr, value, count, false);
|
||||
} else {
|
||||
INFO("Testing hipMemsetD32Async call")
|
||||
INFO("Testing hipMemsetD32Async call");
|
||||
HIP_MEMSET_CHECK_DTYPE(hipMemsetD32Async, devPtr, value, count, true);
|
||||
}
|
||||
break;
|
||||
@@ -262,10 +262,10 @@ template <typename T> void checkMemset2D(T value, size_t width, size_t height, b
|
||||
}
|
||||
|
||||
if (!async) {
|
||||
INFO("Testing hipMemset2D call")
|
||||
INFO("Testing hipMemset2D call");
|
||||
HIP_CHECK(hipMemset2D(devPtr, pitch, value, width * elementSize, height));
|
||||
} else {
|
||||
INFO("Testing hipMemset2DAsync call")
|
||||
INFO("Testing hipMemset2DAsync call");
|
||||
HIP_CHECK(hipMemset2DAsync(devPtr, pitch, value, width * elementSize, height, stream));
|
||||
HIP_CHECK(hipStreamSynchronize(stream));
|
||||
}
|
||||
@@ -355,7 +355,7 @@ template <typename T> void partialMemsetTest2D(T valA, T valB, size_t width, siz
|
||||
checkMemset2D(valA, width, height, async, pitch, devPtr);
|
||||
|
||||
// Set partial region to be second value.
|
||||
INFO("Setting partial square region")
|
||||
INFO("Setting partial square region");
|
||||
checkMemset2D(valB, subWidth, subHeight, async, pitch, devPtr);
|
||||
|
||||
auto hostPtr = get_device_data_2D<T>(devPtr, pitch, width, height);
|
||||
@@ -424,7 +424,7 @@ void check_device_data_3D(hipPitchedPtr& devPitchedPtr, T value, hipExtent exten
|
||||
for (size_t j = 0; j < height; j++) {
|
||||
for (size_t i = 0; i < width; i++) {
|
||||
idx = devPitchedPtr.pitch * height * k + devPitchedPtr.pitch * j + i;
|
||||
INFO("idx=" << idx << " hostPtr[idx]=" << hostPtr[idx] << " value=" << value)
|
||||
INFO("idx=" << idx << " hostPtr[idx]=" << hostPtr[idx] << " value=" << value);
|
||||
HIP_ASSERT(hostPtr[idx] == value);
|
||||
}
|
||||
}
|
||||
@@ -441,10 +441,10 @@ void checkMemset3D(hipPitchedPtr& devPitchedPtr, T value, hipExtent extent, bool
|
||||
HIP_CHECK(hipMalloc3D(&devPitchedPtr, extent));
|
||||
}
|
||||
if (!async) {
|
||||
INFO("Testing hipMemset3D call")
|
||||
INFO("Testing hipMemset3D call");
|
||||
HIP_CHECK(hipMemset3D(devPitchedPtr, value, extent));
|
||||
} else {
|
||||
INFO("Testing hipMemset3DAsync call")
|
||||
INFO("Testing hipMemset3DAsync call");
|
||||
HIP_CHECK(hipMemset3DAsync(devPitchedPtr, value, extent, stream));
|
||||
HIP_CHECK(hipStreamSynchronize(stream));
|
||||
}
|
||||
@@ -531,9 +531,13 @@ void partialMemsetTest3D(T valA, T valB, size_t width, size_t height, size_t dep
|
||||
hipExtent subExtent = make_hipExtent(subWidth * sizeof(T), subHeight, subDepth);
|
||||
|
||||
// Set entire region to be first value.
|
||||
INFO("Setting full cuboid region") { checkMemset3D(devPitchedPtr, valA, extent, async); }
|
||||
INFO("Setting full cuboid region");
|
||||
checkMemset3D(devPitchedPtr, valA, extent, async);
|
||||
|
||||
// Set partial region to be second value.
|
||||
INFO("Setting partial cuboid region") { checkMemset3D(devPitchedPtr, valB, subExtent, async); }
|
||||
INFO("Setting partial cuboid region");
|
||||
checkMemset3D(devPitchedPtr, valB, subExtent, async);
|
||||
|
||||
auto pitch = devPitchedPtr.pitch;
|
||||
auto hostPtr = get_device_data_3D<T>(devPitchedPtr, extent);
|
||||
T comparVal{0};
|
||||
|
||||
@@ -39,39 +39,55 @@ set(TEST_SRC
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-o get_function_module.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc)
|
||||
add_custom_target(get_function_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code)
|
||||
#target_link_libraries(get_function_module.code hip::host hip::device)
|
||||
|
||||
if (NOT WIN32)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-o launch_kernel_module.code
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc)
|
||||
#target_link_libraries(launch_kernel_module.code hip::host hip::device)
|
||||
add_custom_target(launch_kernel_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code)
|
||||
|
||||
add_custom_target(coopKernel.code
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/coopKernel.cpp
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/coopKernel.code
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(coopKernel.code hip::host hip::device)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/coopKernel.code)
|
||||
endif()
|
||||
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc
|
||||
-o launch_kernel_module.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc)
|
||||
add_custom_target(launch_kernel_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-o get_global_test_module.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc)
|
||||
add_custom_target(get_global_test_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code)
|
||||
#target_link_libraries(get_global_test_module.code hip::host hip::device)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-o get_tex_ref_module.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc)
|
||||
add_custom_target(get_tex_ref_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code)
|
||||
|
||||
add_custom_target(coopKernel.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/coopKernel.cpp
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/coopKernel.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(get_tex_ref_module.code hip::host hip::device)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
@@ -87,18 +103,15 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt
|
||||
add_custom_target(empty_file ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt)
|
||||
|
||||
add_custom_target(empty_module
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/empty_module.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/empty_module.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/empty_module.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/coopKernel.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt
|
||||
${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt
|
||||
${CMAKE_CURRENT_BINARY_DIR}/empty_module.code
|
||||
@@ -120,67 +133,91 @@ if(BUILD_SHARED_LIBS)
|
||||
endif()
|
||||
|
||||
add_custom_target(copyKernel.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -mcode-object-version=5 --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 --cuda-device-only
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernel.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(copyKernel.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copyKernel.s
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -mcode-object-version=5 -S ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 -S -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernel.s
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(copyKernel.s hip::host hip::device)
|
||||
|
||||
add_custom_target(addKernel.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -mcode-object-version=5 --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 --cuda-device-only -x hip ${OFFLOAD_ARCH_LIST}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/addKernel.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(addKernel.code hip::host hip::device)
|
||||
|
||||
add_custom_target(addKernel.spv
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco --offload-arch=amdgcnspirv
|
||||
--no-gpu-bundle-output
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/addKernel.spv
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
# TODO - Rock build failure from clang
|
||||
if(NOT WIN32)
|
||||
add_custom_target(addKernel.spv
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only --offload-arch=amdgcnspirv
|
||||
--no-gpu-bundle-output
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/addKernel.spv
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(addKernel.spv hip::host hip::device)
|
||||
|
||||
add_custom_target(addKernel-bundle.spv
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only --offload-arch=amdgcnspirv
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/addKernel-bundle.spv
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(addKernel-bundle.spv hip::host hip::device)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/addKernel.spv
|
||||
${CMAKE_CURRENT_BINARY_DIR}/addKernel-bundle.spv)
|
||||
endif()
|
||||
|
||||
add_custom_target(addKernel-bundle.spv
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco --offload-arch=amdgcnspirv
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/addKernel-bundle.spv
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
|
||||
add_custom_target(copyKernelCompressed.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -mcode-object-version=5 --offload-compress --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 --offload-compress --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernelCompressed.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(copyKernelCompressed.code hip::host hip::device)
|
||||
|
||||
set(OFFLOAD_ARCH_GENERIC_STR "--offload-arch=gfx9-generic --offload-arch=gfx9-4-generic:sramecc+:xnack- --offload-arch=gfx9-4-generic:sramecc-:xnack- --offload-arch=gfx9-4-generic:xnack+ --offload-arch=gfx10-1-generic --offload-arch=gfx10-3-generic --offload-arch=gfx11-generic --offload-arch=gfx12-generic")
|
||||
set(OFFLOAD_ARCH_GENERIC_STR
|
||||
--offload-arch=gfx9-generic
|
||||
--offload-arch=gfx9-4-generic:sramecc+:xnack-
|
||||
--offload-arch=gfx9-4-generic:sramecc-:xnack-
|
||||
--offload-arch=gfx9-4-generic:xnack+
|
||||
--offload-arch=gfx10-1-generic
|
||||
--offload-arch=gfx10-3-generic
|
||||
--offload-arch=gfx11-generic
|
||||
--offload-arch=gfx12-generic
|
||||
)
|
||||
#set(OFFLOAD_ARCH_GENERIC_STR "--offload-arch=gfx9-generic --offload-arch=gfx9-4-generic:sramecc+:xnack- --offload-arch=gfx9-4-generic:sramecc-:xnack- --offload-arch=gfx9-4-generic:xnack+ --offload-arch=gfx10-1-generic --offload-arch=gfx10-3-generic --offload-arch=gfx11-generic --offload-arch=gfx12-generic")
|
||||
add_custom_target(copyKernelGenericTarget.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -mcode-object-version=6 --genco ${OFFLOAD_ARCH_GENERIC_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=6 --cuda-device-only ${OFFLOAD_ARCH_GENERIC_STR}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernelGenericTarget.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(copyKernelGenericTarget.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copyKernelGenericTargetCompressed.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -mcode-object-version=6 --offload-compress --genco ${OFFLOAD_ARCH_GENERIC_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=6 --offload-compress --cuda-device-only
|
||||
${OFFLOAD_ARCH_GENERIC_STR}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernelGenericTargetCompressed.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
#target_link_libraries(copyKernelGenericTargetCompressed.code hip::host hip::device)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copyKernel.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copyKernel.s
|
||||
${CMAKE_CURRENT_BINARY_DIR}/addKernel.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/addKernel.spv
|
||||
${CMAKE_CURRENT_BINARY_DIR}/addKernel-bundle.spv
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copyKernelCompressed.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copyKernelGenericTarget.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copyKernelGenericTargetCompressed.code
|
||||
@@ -192,59 +229,60 @@ set(TEST_SRC
|
||||
hipKerArgOptimization.cc)
|
||||
|
||||
add_custom_target(copiousArgKernel.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copiousArgKernel0.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-mllvm -amdgpu-kernarg-preload-count=0
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel0.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel0.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copiousArgKernel1.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-mllvm -amdgpu-kernarg-preload-count=1
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel1.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel1.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copiousArgKernel2.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-mllvm -amdgpu-kernarg-preload-count=2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel2.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel2.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copiousArgKernel3.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-mllvm -amdgpu-kernarg-preload-count=3
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel3.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel3.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copiousArgKernel16.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-mllvm -amdgpu-kernarg-preload-count=16
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel16.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel16.code hip::host hip::device)
|
||||
|
||||
add_custom_target(copiousArgKernel17.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-mllvm -amdgpu-kernarg-preload-count=17
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel17.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(copiousArgKernel17.code hip::host hip::device)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel0.code
|
||||
@@ -258,7 +296,7 @@ endif()
|
||||
endif()
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
set(RTCLIB "hiprtc")
|
||||
set(RTCLIB "hiprtc::hiprtc")
|
||||
else()
|
||||
set(RTCLIB "nvrtc")
|
||||
endif()
|
||||
@@ -267,12 +305,14 @@ hip_add_exe_to_target(NAME ModuleTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS ${RTCLIB}
|
||||
COMMON_SHARED_SRC ${COMMON_SHARED_SRC}
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
|
||||
if(NOT WIN32)
|
||||
add_dependencies(ModuleTest coopKernel.code)
|
||||
add_dependencies(ModuleTest launch_kernel_module)
|
||||
endif()
|
||||
|
||||
add_dependencies(ModuleTest coopKernel.code)
|
||||
add_dependencies(ModuleTest get_function_module)
|
||||
add_dependencies(ModuleTest launch_kernel_module)
|
||||
add_dependencies(ModuleTest get_global_test_module)
|
||||
add_dependencies(ModuleTest get_tex_ref_module)
|
||||
add_dependencies(ModuleTest not_a_module)
|
||||
@@ -282,8 +322,11 @@ add_dependencies(ModuleTest empty_module)
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
add_dependencies(build_tests copyKernel.code copyKernel.s)
|
||||
add_dependencies(build_tests addKernel.code)
|
||||
add_dependencies(build_tests addKernel.spv)
|
||||
add_dependencies(build_tests addKernel-bundle.spv)
|
||||
# TODO - Rock build failure from clang
|
||||
if(NOT WIN32)
|
||||
add_dependencies(build_tests addKernel.spv)
|
||||
add_dependencies(build_tests addKernel-bundle.spv)
|
||||
endif()
|
||||
add_dependencies(build_tests copyKernelCompressed.code)
|
||||
add_dependencies(build_tests copyKernelGenericTarget.code)
|
||||
add_dependencies(build_tests copyKernelGenericTargetCompressed.code)
|
||||
@@ -295,7 +338,10 @@ endif()
|
||||
endif()
|
||||
|
||||
add_executable(hipGetFuncBySymbol_exe EXCLUDE_FROM_ALL hipGetFuncBySymbol_exe.cc)
|
||||
set_source_files_properties(hipGetFuncBySymbol_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(hipGetFuncBySymbol_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
add_dependencies(build_tests hipGetFuncBySymbol_exe)
|
||||
target_link_libraries(hipGetFuncBySymbol_exe hip::host hip::device)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipGetFuncBySymbol_exe)
|
||||
|
||||
# Common Tests - Test independent of all platforms
|
||||
@@ -318,15 +364,35 @@ endif()
|
||||
hip_add_exe_to_target(NAME module
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
add_custom_target(managed_kernel.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/managed_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/managed_kernel.code -I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(managed_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/managed_kernel.cpp
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../module/managed_kernel.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(managed_kernel.code hip::host hip::device)
|
||||
|
||||
add_custom_target(vcpy_kernel.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/vcpy_kernel.code -I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(vcpy_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/../module/vcpy_kernel.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(vcpy_kernel.code hip::host hip::device)
|
||||
|
||||
add_custom_target(matmul.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/matmul.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/matmul.code -I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(matmul.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
-x hip ${OFFLOAD_ARCH_LIST} ${CMAKE_CURRENT_SOURCE_DIR}/matmul.cpp -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../module/matmul.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(matmul.code hip::host hip::device)
|
||||
|
||||
add_custom_target(kernel_count.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/kernel_count.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_count.code -I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(kernel_count.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kernel_count.cpp -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_count.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(kernel_count.code hip::host hip::device)
|
||||
|
||||
add_custom_target(emptyModuleCount.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/emptyModuleCount.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/emptyModuleCount.code -I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(emptyModuleCount.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/emptyModuleCount.cpp -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../module/emptyModuleCount.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(emptyModuleCount.code hip::host hip::device)
|
||||
|
||||
add_dependencies(ModuleTest managed_kernel.code)
|
||||
add_dependencies(ModuleTest vcpy_kernel.code)
|
||||
@@ -334,7 +400,11 @@ add_dependencies(ModuleTest matmul.code)
|
||||
add_dependencies(ModuleTest kernel_count.code)
|
||||
add_dependencies(ModuleTest emptyModuleCount.code)
|
||||
|
||||
add_custom_target(kernel_composite_test.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} ${CMAKE_CURRENT_SOURCE_DIR}/kernel_composite_test.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_composite_test.code -I${HIP_PATH}/include -I${CMAKE_CURRENT_SOURCE_DIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(kernel_composite_test.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only
|
||||
${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kernel_composite_test.cpp -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_composite_test.code
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT})
|
||||
#target_link_libraries(kernel_composite_test.code hip::host hip::device)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/kernel_composite_test.code
|
||||
${CMAKE_CURRENT_BINARY_DIR}/matmul.code
|
||||
@@ -344,7 +414,10 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/emptyModuleCount.code
|
||||
)
|
||||
add_executable(testhipModuleLoadUnloadFunc_exe EXCLUDE_FROM_ALL testhipModuleLoadUnloadFunc_exe.cc)
|
||||
set_source_files_properties(testhipModuleLoadUnloadFunc_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(testhipModuleLoadUnloadFunc_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS testhipModuleLoadUnloadFunc_exe)
|
||||
target_link_libraries(testhipModuleLoadUnloadFunc_exe hip::host hip::device)
|
||||
|
||||
add_dependencies(module managed_kernel.code vcpy_kernel.code matmul.code kernel_composite_test.code
|
||||
testhipModuleLoadUnloadFunc_exe)
|
||||
|
||||
@@ -18,7 +18,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
#include <hip/hip_cooperative_groups.h>
|
||||
|
||||
using namespace cooperative_groups;
|
||||
@@ -29,7 +29,10 @@ __global__ void cooperativeKernelEx(int* output, int totalThreads) {
|
||||
if (tid < totalThreads) {
|
||||
output[tid] = tid * 3;
|
||||
}
|
||||
grid.sync();
|
||||
// TODO: remove syncthreads with grid sync when compiler issue is fixed
|
||||
// grid.sync();
|
||||
__syncthreads();
|
||||
|
||||
if (tid == 0) {
|
||||
output[0] = 2222;
|
||||
}
|
||||
@@ -51,7 +54,9 @@ __global__ void argKernel(int* val) { *val = 100; }
|
||||
*/
|
||||
__global__ void coopEmptykernel() {
|
||||
cooperative_groups::grid_group grid = cooperative_groups::this_grid();
|
||||
grid.sync();
|
||||
// TODO: remove syncthreads with grid sync when compiler issue is fixed
|
||||
// grid.sync();
|
||||
__syncthreads();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -86,7 +91,9 @@ __global__ void coopFillArrayKernel(int* arr, int* output, int N) {
|
||||
else if (blockIdx.x == 9)
|
||||
arr[9] = 100;
|
||||
|
||||
grid.sync();
|
||||
// TODO: remove syncthreads with grid sync when compiler issue is fixed
|
||||
// grid.sync();
|
||||
__syncthreads();
|
||||
|
||||
for (int i = 0; i < N; i++) {
|
||||
output[blockIdx.x] = output[blockIdx.x] + arr[i];
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
extern "C" __global__ void kernelMultipleArgsSaxpy(int a1, int a2, int* x1, int b1, int b2, int* x2,
|
||||
int c1, int c2, int* x3, int d1, int d2, int* x4,
|
||||
|
||||
@@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
extern "C" __global__ void copy_ker(int* Ad, int* Bd, size_t size) {
|
||||
int myId = threadIdx.x + blockDim.x * blockIdx.x;
|
||||
|
||||
@@ -19,7 +19,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
#include "hip/hip_runtime_api.h"
|
||||
|
||||
#include "hipModuleGetGlobal.hh"
|
||||
|
||||
@@ -113,7 +113,7 @@ TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Functional", "[multigpu]") {
|
||||
launchParamsList[i].args = args + i * NUM_KERNEL_ARGS;
|
||||
}
|
||||
|
||||
INFO("info: launch vector_square kernel with")
|
||||
INFO("info: launch vector_square kernel with");
|
||||
INFO("hipExtLaunchMultiKernelMultiDevice API\n");
|
||||
HIP_CHECK(hipExtLaunchMultiKernelMultiDevice(launchParamsList, nGpu, 0));
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
#define ARR_SIZE (32 * 32)
|
||||
#define SIZE (ARR_SIZE * sizeof(int))
|
||||
|
||||
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
constexpr int GLOBAL_BUF_SIZE = 2048;
|
||||
|
||||
__device__ float deviceGlobalFloat;
|
||||
|
||||
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
extern "C" __device__ void hello_world_2(float* a, float* b) {
|
||||
int tx = threadIdx.x;
|
||||
|
||||
@@ -38,6 +38,8 @@ __global__ void Delay(uint32_t interval, const uint32_t ticks_per_ms) {
|
||||
|
||||
__global__ void CoopKernel() {
|
||||
cooperative_groups::grid_group grid = cooperative_groups::this_grid();
|
||||
grid.sync();
|
||||
// TODO: remove syncthreads with grid sync when compiler issue is fixed
|
||||
// grid.sync();
|
||||
__syncthreads();
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
__managed__ int x = 10;
|
||||
|
||||
extern "C" __global__ void GPU_func() { x++; }
|
||||
|
||||
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
__device__ int deviceGlobal = 1;
|
||||
|
||||
extern "C" __global__ void matmulK(int clockrate, int* A, int* B, int* C, int N) {
|
||||
|
||||
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
extern "C" __global__ void hello_world(float* a, float* b) {
|
||||
int tx = threadIdx.x;
|
||||
|
||||
@@ -14,10 +14,10 @@ set(TEST_SRC
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} --std=c++17
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc
|
||||
-I${HIP_PATH}/include/
|
||||
-o simple_kernel.code --hip-path=${HIP_PATH}
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc
|
||||
-o simple_kernel.code
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc)
|
||||
|
||||
add_custom_target(simple_kernel ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code)
|
||||
|
||||
@@ -17,7 +17,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
extern "C" __global__ void SimpleKernel(int* a, int* b) {
|
||||
int tx = threadIdx.x;
|
||||
|
||||
@@ -13,9 +13,11 @@ if(HIP_PLATFORM MATCHES "amd")
|
||||
set(TEST_SRC ${TEST_SRC} ${AMD_SRC})
|
||||
endif()
|
||||
|
||||
set_source_files_properties(hipDeviceGetP2PAttribute.cc PROPERTIES COMPILE_FLAGS -std=c++17)
|
||||
|
||||
add_executable(hipDeviceGetP2PAttribute_exe EXCLUDE_FROM_ALL hipDeviceGetP2PAttribute_exe.cc)
|
||||
set_source_files_properties(hipDeviceGetP2PAttribute_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(hipDeviceGetP2PAttribute_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(hipDeviceGetP2PAttribute_exe hip::host hip::device)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipDeviceGetP2PAttribute_exe)
|
||||
|
||||
hip_add_exe_to_target(NAME p2pTests
|
||||
|
||||
@@ -10,7 +10,7 @@ set(TEST_SRC
|
||||
if(HIP_PLATFORM MATCHES "nvidia")
|
||||
set(LINKER_LIBS nvrtc)
|
||||
elseif(HIP_PLATFORM MATCHES "amd")
|
||||
set(LINKER_LIBS hiprtc)
|
||||
set(LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -44,8 +44,7 @@ elseif (HIP_PLATFORM MATCHES "nvidia")
|
||||
hip_add_exe_to_target(NAME PrintfTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS ${LINKER_LIBS}
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
LINKER_LIBS ${LINKER_LIBS})
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -67,6 +66,23 @@ add_executable(printfLength_exe EXCLUDE_FROM_ALL printfLength_exe.cc)
|
||||
add_executable(printfSpecifiers_exe EXCLUDE_FROM_ALL printfSpecifiers_exe.cc)
|
||||
add_executable(printfFlagsNonHost_exe EXCLUDE_FROM_ALL printfFlagsNonHost_exe.cc)
|
||||
add_executable(printfSpecifiersNonHost_exe EXCLUDE_FROM_ALL printfSpecifiersNonHost_exe.cc)
|
||||
|
||||
set_source_files_properties(printfFlags_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(printfLength_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(printfSpecifiers_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(printfFlagsNonHost_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(printfSpecifiersNonHost_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(printfFlags_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(printfLength_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(printfSpecifiers_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(printfFlagsNonHost_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_target_properties(printfSpecifiersNonHost_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(printfFlags_exe hip::host hip::device)
|
||||
target_link_libraries(printfLength_exe hip::host hip::device)
|
||||
target_link_libraries(printfSpecifiers_exe hip::host hip::device)
|
||||
target_link_libraries(printfFlagsNonHost_exe hip::host hip::device)
|
||||
target_link_libraries(printfSpecifiersNonHost_exe hip::host hip::device)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS
|
||||
printfFlags_exe
|
||||
printfLength_exe
|
||||
|
||||
@@ -58,16 +58,18 @@ elseif(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME RTC
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
set_source_files_properties(ChkPtrdiff_t_Exe.cc PROPERTIES LANGUAGE HIP)
|
||||
add_executable(ChkPtrdiff_t_Exe EXCLUDE_FROM_ALL ChkPtrdiff_t_Exe.cc)
|
||||
set_target_properties(ChkPtrdiff_t_Exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS ChkPtrdiff_t_Exe)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "nvidia")
|
||||
target_link_libraries(ChkPtrdiff_t_Exe nvrtc)
|
||||
elseif(HIP_PLATFORM MATCHES "amd")
|
||||
target_link_libraries(ChkPtrdiff_t_Exe hiprtc)
|
||||
target_link_libraries(ChkPtrdiff_t_Exe hiprtc::hiprtc hip::host hip::device)
|
||||
endif()
|
||||
|
||||
add_dependencies(build_tests copyRtcHeaders ChkPtrdiff_t_Exe)
|
||||
add_dependencies(RTC copyRtcHeaders ChkPtrdiff_t_Exe)
|
||||
|
||||
@@ -37,177 +37,177 @@ HIPRTC supported compiler option idividually.
|
||||
// SINGLE COMPILER OPTION TESTING
|
||||
const char** null = {};
|
||||
TEST_CASE("Unit_hiprtcGpuArchComplrOptnTst") {
|
||||
INFO("Testing '--gpu-architecture=gfx906:sramecc+:xnack-' compiler opt")
|
||||
INFO("Testing '--gpu-architecture=gfx906:sramecc+:xnack-' compiler opt");
|
||||
REQUIRE(check_architecture(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcGpuRdcComplrOptnTst") {
|
||||
INFO("Testing '-fgpu-rdc' compiler option")
|
||||
INFO("Testing '-fgpu-rdc' compiler option");
|
||||
REQUIRE(check_rdc(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledDenormalsComplrOptnTst") {
|
||||
INFO("Testing '-fgpu-flush-denormals-to-zero' compiler option")
|
||||
INFO("Testing '-fgpu-flush-denormals-to-zero' compiler option");
|
||||
REQUIRE(check_denormals_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledDenormalsComplrOptnTst") {
|
||||
INFO("Testing '-fno-gpu-flush-denormals-to-zero' compiler option")
|
||||
INFO("Testing '-fno-gpu-flush-denormals-to-zero' compiler option");
|
||||
REQUIRE(check_denormals_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcOff_ffpContractComplrOptnTst") {
|
||||
INFO("Testing '-ffp-contract=off' compiler option")
|
||||
INFO("Testing '-ffp-contract=off' compiler option");
|
||||
REQUIRE(check_ffp_contract_off(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcOnffpContractComplrOptnTst") {
|
||||
INFO("Testing '-ffp-contract=on' compiler option")
|
||||
INFO("Testing '-ffp-contract=on' compiler option");
|
||||
REQUIRE(check_ffp_contract_on(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcFastffpContractComplrOptnTst") {
|
||||
INFO("Testing '-ffp-contract=fast' compiler option")
|
||||
INFO("Testing '-ffp-contract=fast' compiler option");
|
||||
REQUIRE(check_ffp_contract_fast(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledFastMathComplrOptnTst") {
|
||||
INFO("Testing '-ffast-math' compiler option")
|
||||
INFO("Testing '-ffast-math' compiler option");
|
||||
REQUIRE(check_fast_math_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledFastMathComplrOptnTst") {
|
||||
INFO("Testing '-fno-fast-math' compiler option")
|
||||
INFO("Testing '-fno-fast-math' compiler option");
|
||||
REQUIRE(check_fast_math_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledSlpVectorizeComplrOptnTst") {
|
||||
INFO("Testing '-fslp-vectorize' compiler option")
|
||||
INFO("Testing '-fslp-vectorize' compiler option");
|
||||
REQUIRE(check_slp_vectorize_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledSlpVectorizeComplrOptnTst") {
|
||||
INFO("Testing '-fno-slp-vectorize' compiler option")
|
||||
INFO("Testing '-fno-slp-vectorize' compiler option");
|
||||
REQUIRE(check_slp_vectorize_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDefineMacroComplrOptnTst") {
|
||||
INFO("Testing '-D' compiler option")
|
||||
INFO("Testing '-D' compiler option");
|
||||
REQUIRE(check_macro(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcUndefMacroComplrOptnTst") {
|
||||
INFO("Testing '-U' compiler option")
|
||||
INFO("Testing '-U' compiler option");
|
||||
REQUIRE(check_undef_macro(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcHeaderDirectoryComplrOptnTst") {
|
||||
INFO("Testing '-I' compiler option")
|
||||
INFO("Testing '-I' compiler option");
|
||||
REQUIRE(check_header_dir(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcWarningComplrOptnTst") {
|
||||
INFO("Testing '-w' compiler option")
|
||||
INFO("Testing '-w' compiler option");
|
||||
REQUIRE(check_warning(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcRpassInlineComplrOptnTst") {
|
||||
INFO("Testing '-Rpass=inline' compiler option")
|
||||
INFO("Testing '-Rpass=inline' compiler option");
|
||||
REQUIRE(check_Rpass_inline(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledConversionErrComplrOptnTst") {
|
||||
INFO("Testing '-Werror=conversion' compiler option")
|
||||
INFO("Testing '-Werror=conversion' compiler option");
|
||||
REQUIRE(check_conversionerror_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledConversionErrComplrOptnTst") {
|
||||
INFO("Testing '-Wno-error=conversion' compiler option")
|
||||
INFO("Testing '-Wno-error=conversion' compiler option");
|
||||
REQUIRE(check_conversionerror_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledConversionWarningComplrOptnTst") {
|
||||
INFO("Testing '-Wconversion' compiler option")
|
||||
INFO("Testing '-Wconversion' compiler option");
|
||||
REQUIRE(check_conversionwarning_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledConversionWarningComplrOptnTst") {
|
||||
INFO("Testing '-Wno-conversion' compiler option")
|
||||
INFO("Testing '-Wno-conversion' compiler option");
|
||||
REQUIRE(check_conversionwarning_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcGpuMaxThreadPerBlockComplrOptnTst") {
|
||||
INFO("Testing '--gpu-max-threads-per-block=n' compiler option")
|
||||
INFO("Testing '--gpu-max-threads-per-block=n' compiler option");
|
||||
REQUIRE(check_max_thread(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledUnsafeAtomicComplrOptnTst") {
|
||||
INFO("Testing '-munsafe-fp-atomics' compiler option")
|
||||
INFO("Testing '-munsafe-fp-atomics' compiler option");
|
||||
REQUIRE(check_unsafe_atomic_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledUnsafeAtomicComplrOptnTst") {
|
||||
INFO("Testing '-mno-unsafe-fp-atomics' compiler option")
|
||||
INFO("Testing '-mno-unsafe-fp-atomics' compiler option");
|
||||
REQUIRE(check_unsafe_atomic_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledInfiniteNumComplrOptnTst") {
|
||||
INFO("Testing '-fhonor-infinities' compiler option")
|
||||
INFO("Testing '-fhonor-infinities' compiler option");
|
||||
REQUIRE(check_infinite_num_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledInfiniteNumComplrOptnTst") {
|
||||
INFO("Testing '-fno-honor-infinities' compiler option")
|
||||
INFO("Testing '-fno-honor-infinities' compiler option");
|
||||
REQUIRE(check_infinite_num_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledNANComplrOptnTst") {
|
||||
INFO("Testing '-fhonor-nans' compiler option")
|
||||
INFO("Testing '-fhonor-nans' compiler option");
|
||||
REQUIRE(check_NAN_num_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledNANComplrOptnTst") {
|
||||
INFO("Testing '-fno-honor-nans' compiler option")
|
||||
INFO("Testing '-fno-honor-nans' compiler option");
|
||||
REQUIRE(check_NAN_num_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledFiniteMathComplrOptnTst") {
|
||||
INFO("Testing '-ffinite-math-only' compiler option")
|
||||
INFO("Testing '-ffinite-math-only' compiler option");
|
||||
REQUIRE(check_finite_math_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledFiniteMathComplrOptnTst") {
|
||||
INFO("Testing '-fno-finite-math-only' compiler option")
|
||||
INFO("Testing '-fno-finite-math-only' compiler option");
|
||||
REQUIRE(check_finite_math_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledAssociativeMathComplrOptnTst") {
|
||||
INFO("Testing '-fassociative-math' compiler option")
|
||||
INFO("Testing '-fassociative-math' compiler option");
|
||||
REQUIRE(check_associative_math_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledAssociativeMathComplrOptnTst") {
|
||||
INFO("Testing '-fno-associative-math' compiler option")
|
||||
INFO("Testing '-fno-associative-math' compiler option");
|
||||
REQUIRE(check_associative_math_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledSignedZerosComplrOptnTst") {
|
||||
INFO("Testing '-fsigned-zeros' compiler option")
|
||||
INFO("Testing '-fsigned-zeros' compiler option");
|
||||
REQUIRE(check_signed_zeros_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledSignedZerosComplrOptnTst") {
|
||||
INFO("Testing '-fno-signed-zeros' compiler option")
|
||||
INFO("Testing '-fno-signed-zeros' compiler option");
|
||||
REQUIRE(check_signed_zeros_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcEnabledTrappingMathComplrOptnTst") {
|
||||
INFO("Testing '-ftrapping-math' compiler option")
|
||||
INFO("Testing '-ftrapping-math' compiler option");
|
||||
REQUIRE(check_trapping_math_enabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hiprtcDisabledTrappingMathComplrOptnTst") {
|
||||
INFO("Testing '-fno-trapping-math' compiler option")
|
||||
INFO("Testing '-fno-trapping-math' compiler option");
|
||||
REQUIRE(check_trapping_math_disabled(null, -1, -1, -1));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ THE SOFTWARE.
|
||||
#include <tuple>
|
||||
#include <cmd_options.hh>
|
||||
#include <functional>
|
||||
#include <algorithm>
|
||||
|
||||
#define NELEMS(array) (sizeof(array) / sizeof(array[0]))
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ set(TEST_SRC
|
||||
hipStreamLegacy_compiler_options.cc
|
||||
hipStreamGetId.cc
|
||||
hipStreamSetGetAttributes.cc
|
||||
# TODO renable it TheRock is not finding it
|
||||
hipStreamCopyAttributes.cc)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
@@ -39,9 +40,6 @@ else()
|
||||
# in function definition of hipStreamAttachMemAsync
|
||||
# Fixing would break ABI, to be re-enabled when the fix is made.
|
||||
hipStreamACb_MultiThread.cc)
|
||||
|
||||
# set_source_files_properties(hipStreamAttachMemAsync_old.cc PROPERTIES
|
||||
# COMPILE_FLAGS -std=c++17)
|
||||
endif()
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
@@ -54,8 +52,12 @@ endif()
|
||||
hip_add_exe_to_target(
|
||||
NAME StreamTest
|
||||
TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++17 COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
|
||||
add_executable(hipStreamLegacy_exe EXCLUDE_FROM_ALL hipStreamLegacy_exe.cc)
|
||||
set_source_files_properties(hipStreamLegacy_exe.cc PROPERTIES LANGUAGE HIP)
|
||||
set_target_properties(hipStreamLegacy_exe PROPERTIES LINKER_LANGUAGE HIP)
|
||||
target_link_libraries(hipStreamLegacy_exe hip::host hip::device)
|
||||
|
||||
add_dependencies(StreamTest hipStreamLegacy_exe)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipStreamLegacy_exe)
|
||||
|
||||
@@ -59,7 +59,7 @@ TEST_CASE("Unit_hipMultiStream_sameDevice") {
|
||||
HIP_CHECK(hipMemcpy(&y, yd, sizeof(float), hipMemcpyDeviceToHost));
|
||||
HIP_CHECK(hipFree(xd));
|
||||
HIP_CHECK(hipFree(yd));
|
||||
REQUIRE(x == Approx(y));
|
||||
REQUIRE(x == Catch::Approx(y));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipMultiStream_multimeDevice") {
|
||||
|
||||
@@ -18,7 +18,7 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include "hip/hip_runtime.h"
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
static constexpr int N = 2 * 1024 * 1024;
|
||||
static constexpr size_t NBYTES = N * sizeof(int);
|
||||
|
||||
@@ -4,7 +4,7 @@ set(TEST_SRC
|
||||
hipStreamPerThread_Event.cc
|
||||
hipStreamPerThread_MultiThread.cc
|
||||
hipStreamPerThread_DeviceReset.cc
|
||||
hipStreamPerThrdTsts.cc
|
||||
# hipStreamPerThrdTsts.cc TODO
|
||||
hipStreamPerThrdCompilerOptn.cc
|
||||
)
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
set(TEST_SRC
|
||||
copy_coherency.cc
|
||||
)
|
||||
add_custom_target(memcpyInt.hsaco COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memcpyIntDevice.cpp -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../synchronization/memcpyInt.hsaco -I
|
||||
${HIP_PATH}/include -I
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../include -L
|
||||
${HIP_PATH}/${CMAKE_INSTALL_LIBDIR}/../../include --hip-path=${HIP_PATH})
|
||||
add_custom_target(memcpyInt.hsaco COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST}
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/memcpyIntDevice.cpp -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../synchronization/memcpyInt.hsaco
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/memcpyInt.hsaco)
|
||||
# only for AMD
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
|
||||
@@ -35,7 +35,7 @@ elseif(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME SyncthreadsTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -62,4 +62,4 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC})
|
||||
# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py
|
||||
# ./src ${HIP_PLATFORM} ${HIP_PATH}
|
||||
# __syncthreads_or_negative_kernels.cc 2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -99,9 +99,10 @@ function(CheckRejectedArchs OFFLOAD_ARCH_STR_LOCAL)
|
||||
endfunction() # CheckAcceptedArchs
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code
|
||||
COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} --std=c++17 -Wno-deprecated-declarations ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc
|
||||
COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} -Wno-deprecated-declarations
|
||||
-x hip ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc
|
||||
-I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}
|
||||
-o tex_ref_get_module.code
|
||||
-I${HIP_PATH}/include/ --hip-path=${HIP_PATH}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc)
|
||||
add_custom_target(tex_ref_get_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code)
|
||||
set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code)
|
||||
|
||||
@@ -35,7 +35,7 @@ elseif(HIP_PLATFORM MATCHES "amd")
|
||||
hip_add_exe_to_target(NAME VectorTypesTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
LINKER_LIBS hiprtc)
|
||||
LINKER_LIBS hiprtc::hiprtc)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
|
||||
Reference in New Issue
Block a user