Doc and test updates.
Change-Id: I44cbd2c0de7cb692d0194d1bb8b8ae25c58d4e00
This commit is contained in:
@@ -213,6 +213,9 @@ export HIP_ATP_MARKER=1
|
||||
```shell
|
||||
# Use profile to generate timeline view:
|
||||
/opt/rocm/bin/rocm-profiler -o <outputATPFileName> -A <applicationName> <applicationArguments>
|
||||
|
||||
Or
|
||||
/opt/rocm/bin/rocm-profiler -e HIP_ATP_MARKER=1 -o <outputATPFileName> -A <applicationName> <applicationArguments>
|
||||
```
|
||||
|
||||
#### Using HIP_TRACE_API
|
||||
|
||||
@@ -50,3 +50,12 @@ ctest
|
||||
ctest -R Memcpy
|
||||
```
|
||||
|
||||
|
||||
### If a test fails:
|
||||
|
||||
Extract the commandline from the testing log:
|
||||
$ grep -A3 -m2 hipMemcpy-size Testing/Temporary/LastTest.log
|
||||
36/47 Testing: hipMemcpy-size
|
||||
36/47 Test: hipMemcpy-size
|
||||
Command: "/home/bensander/git/compute/external/hip/hip/tests/b6.hcc-LC.debug/runtimeApi/memory/hipMemcpy" "--tests" "0x6"
|
||||
Directory: /home/bensander/git/compute/external/hip/hip/tests/b6.hcc-LC.debug/runtimeApi/memory
|
||||
|
||||
@@ -166,7 +166,8 @@ build_hip_executable (hipEventRecord hipEventRecord.cpp)
|
||||
build_hip_executable_libcpp (hipHcc hipHcc.cpp)
|
||||
#set_source_files_properties (hipHcc.cpp PROPERTIES COMPILE_FLAGS --stdlib=libc++ )
|
||||
|
||||
build_hip_executable_libcpp (hipPointerAttrib hipPointerAttrib.cpp)
|
||||
# __workweek fix.
|
||||
#build_hip_executable_libcpp (hipPointerAttrib hipPointerAttrib.cpp)
|
||||
build_hip_executable (hipHostAlloc hipHostAlloc.cpp)
|
||||
build_hip_executable (hipHostGetFlags hipHostGetFlags.cpp)
|
||||
build_hip_executable (hipHostRegister hipHostRegister.cpp)
|
||||
|
||||
+12
-9
@@ -23,6 +23,8 @@ THE SOFTWARE.
|
||||
#include<fstream>
|
||||
#include<vector>
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
#define LEN 64
|
||||
#define SIZE LEN<<2
|
||||
|
||||
@@ -45,17 +47,17 @@ int main(){
|
||||
std::cout<<A[i] << " "<<B[i]<<std::endl;
|
||||
}
|
||||
|
||||
hipMalloc((void**)&Ad, SIZE);
|
||||
hipMalloc((void**)&Bd, SIZE);
|
||||
HIPCHECK(hipMalloc((void**)&Ad, SIZE));
|
||||
HIPCHECK(hipMalloc((void**)&Bd, SIZE));
|
||||
|
||||
hipMemcpy(Ad, A, SIZE, hipMemcpyHostToDevice);
|
||||
hipMemcpy(Bd, B, SIZE, hipMemcpyHostToDevice);
|
||||
HIPCHECK(hipMemcpy(Ad, A, SIZE, hipMemcpyHostToDevice));
|
||||
HIPCHECK(hipMemcpy(Bd, B, SIZE, hipMemcpyHostToDevice));
|
||||
hipModule_t Module;
|
||||
hipFunction_t Function;
|
||||
hipModuleLoad(&Module, fileName);
|
||||
hipModuleGetFunction(&Function, Module, kernel_name);
|
||||
HIPCHECK(hipModuleLoad(&Module, fileName));
|
||||
HIPCHECK(hipModuleGetFunction(&Function, Module, kernel_name));
|
||||
hipStream_t stream;
|
||||
hipStreamCreate(&stream);
|
||||
HIPCHECK(hipStreamCreate(&stream));
|
||||
void *args[2] = {&Ad, &Bd};
|
||||
|
||||
|
||||
@@ -73,9 +75,9 @@ int main(){
|
||||
|
||||
hipModuleLaunchKernel(Function, 1, 1, 1, LEN, 1, 1, 0, stream, NULL, (void**)&config);
|
||||
|
||||
hipStreamDestroy(stream);
|
||||
HIPCHECK(hipStreamDestroy(stream));
|
||||
|
||||
hipMemcpy(B, Bd, SIZE, hipMemcpyDeviceToHost);
|
||||
HIPCHECK(hipMemcpy(B, Bd, SIZE, hipMemcpyDeviceToHost));
|
||||
|
||||
for(uint32_t i=0;i<LEN;i++){
|
||||
std::cout<<A[i]<<" - "<<B[i]<<std::endl;
|
||||
@@ -83,3 +85,4 @@ int main(){
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ int main(int argc, char *argv[])
|
||||
parseMyArguments(argc, argv);
|
||||
|
||||
|
||||
printf ("info: set device to %d\n", p_gpuDevice);
|
||||
printf ("info: set device to %d tests=%x\n", p_gpuDevice, p_tests);
|
||||
HIPCHECK(hipSetDevice(p_gpuDevice));
|
||||
|
||||
if (p_tests & 0x01) {
|
||||
|
||||
@@ -68,8 +68,9 @@ THE SOFTWARE.
|
||||
{\
|
||||
hipError_t localError = error; \
|
||||
if (localError != hipSuccess) { \
|
||||
printf("%serror: '%s'(%d) at %s:%d%s\n", \
|
||||
printf("%serror: '%s'(%d) from %s at %s:%d%s\n", \
|
||||
KRED,hipGetErrorString(localError), localError,\
|
||||
#error,\
|
||||
__FILE__, __LINE__,KNRM); \
|
||||
failed("API returned error code.");\
|
||||
}\
|
||||
|
||||
Reference in New Issue
Block a user