SWDEV-299773 - Enable performance tests on NV (#2337)

1. Simply enable test on NV
   Some need minor fix
performance/compute/hipPerfDotProduct.cpp
performance/dispatch/hipPerfDispatchSpeed.cpp
performance/memory/hipPerfBufferCopyRectSpeed.cpp
performance/memory/hipPerfBufferCopySpeed.cpp
performance/memory/hipPerfDevMemReadSpeed.cpp
performance/memory/hipPerfDevMemWriteSpeed.cpp
performance/memory/hipPerfMemcpy.cpp
performance/memory/hipPerfMemset.cpp
performance/memory/hipPerfSharedMemReadSpeed.cpp
performance/stream/hipPerfDeviceConcurrency.cpp
performance/stream/hipPerfStreamCreateCopyDestroy.cpp

2. Enable and fix on NV
performance/compute/hipPerfMandelbrot.cpp
   Root cause: coordIdx is random
   Solution: Initialize coordIdx correctly
performance/memory/hipPerfMemFill.cpp
   Root cause: Hip ext Apis called.
   Solution: Exclude case with Hip ext Apis involved
performance/memory/hipPerfMemMallocCpyFree.cpp
   Root cause: Test allocates device memory more than GPU has.
   Solution: Allocate device memory in terms of GPU capacity.
tests/performance/memory/hipPerfSampleRate.cpp
   Root cause: Cuda has no operators += for float2 and float4.
   Solution: Provide the operators.
performance/stream/hipPerfStreamConcurrency.cpp
   Root cause:float4 format doesn't match cude.
              operators are missing in cuda lib.
   Solution: Use (x, y, z, w) format.
             Add necessary float4 operatoris for cuda.

Change-Id: I5add29ebabcfb21fb3ef89d09004c5d13423a291
This commit is contained in:
TomSang
2021-09-14 04:07:13 -04:00
zatwierdzone przez GitHub
rodzic 3fd16c0b5b
commit 9035ae3154
16 zmienionych plików z 133 dodań i 112 usunięć
@@ -22,7 +22,7 @@ THE SOFTWARE.
#include <time.h>
/* HIT_START
* BUILD: %t %s ../../src/test_common.cpp EXCLUDE_HIP_PLATFORM nvidia
* BUILD: %t %s ../../src/test_common.cpp
* TEST: %t
* HIT_END
*/
@@ -37,10 +37,15 @@ void valSet(int* A, int val, size_t size) {
}
}
void setup(size_t *size, const int num, int **pA) {
void setup(size_t *size, int &num, int **pA, const size_t totalGlobalMem) {
std::cout << "size: ";
for (int i = 0; i < num; i++) {
size[i] = 1 << (i + 6);
if((NUM_ITER + 1) * size[i] > totalGlobalMem) {
num = i;
break;
}
std::cout << size[i] << " ";
}
std::cout << std::endl;
@@ -77,11 +82,16 @@ int main() {
size_t size[NUM_SIZE] = { 0 };
int *Ad[NUM_ITER] = { nullptr };
int *A;
hipDeviceProp_t props;
memset(&props, 0, sizeof(props));
HIPCHECK(hipGetDeviceProperties(&props, 0));
std::cout << "totalGlobalMem: " << props.totalGlobalMem << std::endl;
setup(size, NUM_SIZE, &A);
int num = NUM_SIZE;
setup(size, num, &A, props.totalGlobalMem);
testInit(size[0], A);
for (int i = 0; i < NUM_SIZE; i++) {
for (int i = 0; i < num; i++) {
std::cout << size[i] << std::endl;
start = clock();
for (int j = 0; j < NUM_ITER; j++) {