Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging
This commit is contained in:
+16
-15
@@ -1,6 +1,9 @@
|
||||
Tests uses CMAKE as teh build infrastructure.
|
||||
# HIP testing environment.
|
||||
|
||||
Use :
|
||||
This document explains how to use the HIP CMAKE testing environment.
|
||||
|
||||
### Quickstart
|
||||
Usage :
|
||||
```
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
@@ -9,31 +12,29 @@ $ make
|
||||
$ make test
|
||||
```
|
||||
|
||||
#-----
|
||||
### How to add a new test
|
||||
|
||||
edit src/CMakeFiles to add the test:
|
||||
The tests/src/hipMemtest.cpp file contains a simple unit test and is a good starting point for other tests.
|
||||
Copy this to a new test name and modify tests/src/CMakefiles.txt to add the test to the build environment.
|
||||
|
||||
### add the executable and list of required CPP files, ie:
|
||||
#### Edit CMakefiles.txt:
|
||||
// Example:
|
||||
```
|
||||
make_test (EXE CPP_FILES)
|
||||
make_hip_executable (hipMemset hipMemset.cpp)
|
||||
```
|
||||
|
||||
### Add to automated Test framework:
|
||||
```
|
||||
make_test (TESTNAME ARGS)
|
||||
make_hip_executable (hipMemset hipMemset.cpp)
|
||||
make_test(hipMemset " ")
|
||||
```
|
||||
|
||||
|
||||
### Running tests:
|
||||
```
|
||||
make test
|
||||
ctest
|
||||
```
|
||||
|
||||
# Run a specific test:
|
||||
### Run subsets of all tests:
|
||||
```
|
||||
# Run one test on the commandline (obtain commandline parms from CMakefiles.tst)
|
||||
./hipMemset
|
||||
|
||||
# Run all the memory tests:
|
||||
ctest -R Memcpy
|
||||
```
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ if (${HIP_PLATFORM} STREQUAL "hcc")
|
||||
#Include HIP and HC since the tests need both of these:
|
||||
#Note below HSA path is surgically included only where necessary.
|
||||
include_directories(${HIP_PATH}/include)
|
||||
include_directories(${HSA_PATH}/include)
|
||||
# hip_hcc.o:
|
||||
#add_library(hip_hcc STATIC ${HIP_PATH}/src/hip_hcc.cpp )
|
||||
add_library(hip_hcc STATIC ${HIP_PATH}/src/hip_hcc.cpp ${HIP_PATH}/src/hip_error.cpp ${HIP_PATH}/src/hip_device.cpp ${HIP_PATH}/src/hip_stream.cpp ${HIP_PATH}/src/hip_event.cpp ${HIP_PATH}/src/hip_memory.cpp ${HIP_PATH}/src/hip_peer.cpp ${HIP_PATH}/src/staging_buffer.cpp)
|
||||
target_include_directories(hip_hcc PRIVATE ${HSA_PATH}/include ${CODEXL_SDK_ATAL_PATH}/include)
|
||||
include_directories(${HSA_PATH}/include)
|
||||
|
||||
# This will create a subdir "hip_hcc" in the test build directory
|
||||
# Any changes to hip_hcc source will be detected and force the library and then the tests to be rebuilt.
|
||||
add_subdirectory(${HIP_PATH} hip_hcc)
|
||||
link_directories(${CMAKE_CURRENT_BINARY_DIR}/hip_hcc) # search the local hip_hcc for libhip_hcc.a
|
||||
|
||||
elseif (${HIP_PLATFORM} STREQUAL "nvcc")
|
||||
MESSAGE ("HIP_PLATFORM=nvcc")
|
||||
@@ -62,6 +62,8 @@ else()
|
||||
endif()
|
||||
|
||||
set (HIPCC ${HIP_PATH}/bin/hipcc)
|
||||
set (CMAKE_CXX_COMPILER ${HIPCC})
|
||||
set (CMAKE_CXX_FLAGS --hipcc_explicit_lib)
|
||||
|
||||
|
||||
add_library(test_common OBJECT test_common.cpp )
|
||||
@@ -71,7 +73,7 @@ add_library(test_common OBJECT test_common.cpp )
|
||||
macro (make_hip_executable exe cpp)
|
||||
if (${HIP_PLATFORM} STREQUAL "hcc")
|
||||
add_executable (${exe} ${cpp} ${ARGN} $<TARGET_OBJECTS:test_common> )
|
||||
# target_link_libraries(${exe} hip_hcc)
|
||||
target_link_libraries(${exe} hip_hcc)
|
||||
else()
|
||||
add_executable (${exe} ${cpp} ${ARGN} $<TARGET_OBJECTS:test_common> )
|
||||
endif()
|
||||
@@ -116,7 +118,6 @@ macro (make_test_matches exe match_string)
|
||||
endmacro()
|
||||
|
||||
|
||||
set (CMAKE_CXX_COMPILER ${HIPCC})
|
||||
|
||||
#make_hip_executable (hipAPIStreamEnable hipAPIStreamEnable.cpp)
|
||||
#make_hip_executable (hipAPIStreamDisable hipAPIStreamDisable.cpp)
|
||||
|
||||
Reference in New Issue
Block a user