SWDEV-475568 - Fix compiling issues
Fix compiling issues of "make perf_test" under hip-tests. Change-Id: Ib03328a2fb13375fa44626a42202b1eeb177b8b2
このコミットが含まれているのは:
1 親
2f067487d2
コミット
a2f37dfa3a
7ファイル変更
+50
-49
検索条件に一致するファイルはありません
@@ -105,12 +105,12 @@ void hipPerfDeviceConcurrency::close() {
|
||||
|
||||
bool hipPerfDeviceConcurrency::run(unsigned int testCase, int numGpus) {
|
||||
static int deviceId;
|
||||
uint * hPtr[numGpus];
|
||||
uint * dPtr[numGpus];
|
||||
hipStream_t streams[numGpus];
|
||||
int numCUs[numGpus];
|
||||
unsigned int maxIter[numGpus];
|
||||
unsigned long long expectedIters[numGpus];
|
||||
uint ** hPtr = new uint*[numGpus];
|
||||
uint ** dPtr = new uint*[numGpus];
|
||||
hipStream_t * streams = new hipStream_t[numGpus];
|
||||
int *numCUs = new int[numGpus];
|
||||
unsigned int *maxIter = new unsigned int[numGpus];
|
||||
unsigned long long *expectedIters = new unsigned long long[numGpus];
|
||||
|
||||
int threads, threads_per_block, blocks;
|
||||
float xStep, yStep, xPos, yPos;
|
||||
@@ -121,7 +121,7 @@ bool hipPerfDeviceConcurrency::run(unsigned int testCase, int numGpus) {
|
||||
}
|
||||
|
||||
HIP_CHECK(hipSetDevice(deviceId));
|
||||
hipDeviceProp_t props = {0};
|
||||
hipDeviceProp_t props;
|
||||
HIP_CHECK(hipGetDeviceProperties(&props, i));
|
||||
if (testCase != 0) {
|
||||
std::cout << "info: running on bus " << "0x" << props.pciBusID
|
||||
@@ -220,6 +220,12 @@ bool hipPerfDeviceConcurrency::run(unsigned int testCase, int numGpus) {
|
||||
if (testCase == 0) {
|
||||
deviceId++;
|
||||
}
|
||||
delete [] hPtr;
|
||||
delete [] dPtr;
|
||||
delete [] streams;
|
||||
delete [] numCUs;
|
||||
delete [] maxIter;
|
||||
delete [] expectedIters;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ bool hipPerfStreamConcurrency::open(int deviceId) {
|
||||
}
|
||||
|
||||
HIP_CHECK(hipSetDevice(deviceId));
|
||||
hipDeviceProp_t props = {0};
|
||||
hipDeviceProp_t props;
|
||||
HIP_CHECK(hipGetDeviceProperties(&props, deviceId));
|
||||
std::cout << "info: running on bus " << "0x" << props.pciBusID
|
||||
<< " " << props.name << " with " << props.multiProcessorCount << " CUs"
|
||||
@@ -250,12 +250,12 @@ bool hipPerfStreamConcurrency::run(unsigned int testCase,
|
||||
|
||||
// Maximum iteration count
|
||||
// maxIter = 8388608 * (engine_clock / 1000).serial execution
|
||||
maxIter = (unsigned int)(((8388608 * (static_cast<float>clkFrequency / 1000))
|
||||
maxIter = (unsigned int)(((8388608 * (static_cast<float>(clkFrequency) / 1000))
|
||||
* numCUs) / 128);
|
||||
maxIter = (maxIter + 15) & ~15;
|
||||
hipStream_t streams[numStreams];
|
||||
uint * hPtr[numKernels];
|
||||
uint * dPtr[numKernels];
|
||||
hipStream_t *streams = new hipStream_t[numStreams];
|
||||
uint ** hPtr = new uint*[numKernels];
|
||||
uint ** dPtr = new uint*[numKernels];
|
||||
|
||||
// Width is divisible by 4 because the mandelbrot kernel
|
||||
// processes 4 pixels at once.
|
||||
@@ -327,9 +327,6 @@ bool hipPerfStreamConcurrency::run(unsigned int testCase,
|
||||
<< numStreams <<" stream (s): " << all_kernel_time.count() << std::endl;
|
||||
}
|
||||
|
||||
unsigned long long expected =
|
||||
(unsigned long long)width_ * (unsigned long long)maxIter;
|
||||
|
||||
for (uint i = 0 ; i < numStreams; i++) {
|
||||
HIP_CHECK(hipStreamDestroy(streams[i]));
|
||||
}
|
||||
@@ -339,6 +336,10 @@ bool hipPerfStreamConcurrency::run(unsigned int testCase,
|
||||
HIP_CHECK(hipHostFree(hPtr[i]));
|
||||
HIP_CHECK(hipFree(dPtr[i]));
|
||||
}
|
||||
|
||||
delete [] streams;
|
||||
delete [] hPtr;
|
||||
delete [] dPtr;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ bool hipPerfStreamCreateCopyDestroy::open(int deviceId) {
|
||||
HipTest::HIP_SKIP_TEST("Skipping because devices < 1");
|
||||
}
|
||||
HIP_CHECK(hipSetDevice(deviceId));
|
||||
hipDeviceProp_t props = {0};
|
||||
hipDeviceProp_t props;
|
||||
HIP_CHECK(hipGetDeviceProperties(&props, deviceId));
|
||||
std::cout << "info: running on bus " << "0x" << props.pciBusID
|
||||
<< " " << props.name << " with " << props.multiProcessorCount << " CUs"
|
||||
@@ -71,10 +71,10 @@ bool hipPerfStreamCreateCopyDestroy::run(unsigned int testNumber) {
|
||||
numStreams_ = totalStreams_[testNumber % TotalStreams];
|
||||
size_t iter = Iterations / (numStreams_ * (static_cast<size_t>(1)
|
||||
<< (testNumber / TotalBufs + 1)));
|
||||
hipStream_t streams[numStreams_];
|
||||
hipStream_t *streams = new hipStream_t[numStreams_];
|
||||
|
||||
numBuffers_ = totalBuffers_[testNumber / TotalBufs];
|
||||
float* dSrc[numBuffers_];
|
||||
float ** dSrc = new float*[numBuffers_];
|
||||
size_t nBytes = BufSize * sizeof(float);
|
||||
|
||||
for (size_t b = 0; b < numBuffers_; ++b) {
|
||||
@@ -120,6 +120,9 @@ bool hipPerfStreamCreateCopyDestroy::run(unsigned int testNumber) {
|
||||
for (size_t b = 0; b < numBuffers_; ++b) {
|
||||
HIP_CHECK(hipFree(dSrc[b]));
|
||||
}
|
||||
|
||||
delete [] streams;
|
||||
delete [] dSrc;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする