Make emulator friendly

Disable some tests that rely on features not typically available
in emulator and use smaller data and iteration sets

Change-Id: I587bf83162b114719e0361109ed44c6bf2adf34c
This commit is contained in:
Chris Freehill
2018-06-03 15:13:48 -05:00
والد 845a539478
کامیت 2c8cbf61c3
8فایلهای تغییر یافته به همراه35 افزوده شده و 7 حذف شده
@@ -59,11 +59,6 @@
#include "hsa/hsa.h"
#include "hsa/hsa_ext_finalize.h"
static const uint32_t kNumBufferElements = 256;
#define RET_IF_HSA_ERR(err) { \
if ((err) != HSA_STATUS_SUCCESS) { \
@@ -156,7 +151,13 @@ static void PrintMemorySubtestHeader(const char *header) {
std::cout << " *** Memory Subtest: " << header << " ***" << std::endl;
}
#if ROCRTST_EMULATOR_BUILD
static const int kMemoryAllocSize = 8;
#else
static const int kMemoryAllocSize = 1024;
#endif
// Test to check GPU can read & write to system memory
void MemoryAccessTest::GPUAccessToCPUMemoryTest(hsa_agent_t cpuAgent,
hsa_agent_t gpuAgent) {
@@ -61,7 +61,12 @@ DispatchTime(bool defaultInterrupt, bool launchSingleKernel) : TestBase(),
use_default_interupt_(defaultInterrupt),
launch_single_(launchSingleKernel) {
queue_size_ = 0;
#ifdef ROCRTST_EMULATOR_BUILD
num_batch_ = 10;
#else
num_batch_ = 100000;
#endif
memset(&aql(), 0, sizeof(hsa_kernel_dispatch_packet_t));
dispatch_time_mean_ = 0.0;
set_num_iteration(100);
@@ -71,7 +71,12 @@ EnqueueLatency::
EnqueueLatency(bool enqueueSinglePacket) : TestBase(),
enqueue_single_(enqueueSinglePacket) {
queue_size_ = 0;
#if ROCRTST_EMULATOR_BUILD
num_of_pkts_ = 10;
#else
num_of_pkts_ = 100000;
#endif
memset(&aql(), 0, sizeof(hsa_kernel_dispatch_packet_t));
enqueue_time_mean_ = 0.0;
set_num_iteration(100);
@@ -449,7 +449,7 @@ void MemoryAsyncCopy::DisplayBenchmark(Transaction *t) const {
printf("Data Size Avg Time(us) Avg BW(GB/s)"
" Min Time(us) Peak BW(GB/s)\n");
for (int i = 0; i < 20; i++) {
for (int i = 0; i < kNumGranularity; i++) {
if (Size[i] > size) {
break;
}
@@ -195,6 +195,12 @@ class MemoryAsyncCopy : public TestBase {
protected:
void PrintTransactionType(Transaction *t);
#if ROCRTST_EMULATOR_BUILD
static const int kNumGranularity = 1;
static constexpr const char* Str[kNumGranularity] = {"1k"};
static constexpr const size_t Size[kNumGranularity] = {1024};
#else
static const int kNumGranularity = 20;
static constexpr const char* Str[kNumGranularity] = {
@@ -206,7 +212,7 @@ class MemoryAsyncCopy : public TestBase {
256*1024, 512*1024, 1024*1024, 2048*1024, 4096*1024, 8*1024*1024,
16*1024*1024, 32*1024*1024, 64*1024*1024, 128*1024*1024, 256*1024*1024,
512*1024*1024};
#endif
static constexpr const int kMaxCopySize = Size[kNumGranularity - 1];
// @Brief: Get real iteration number
@@ -166,6 +166,11 @@ if(${BUILD_TYPE} STREQUAL "Debug")
add_definitions(-DDEBUG)
endif()
if(${EMULATOR_BUILD})
add_definitions(-DROCRTST_EMULATOR_BUILD=1)
endif()
add_definitions(-D__linux__)
add_definitions(-DLITTLEENDIAN_CPU=1)
@@ -192,6 +192,7 @@ TEST(rocrtstFunc, Signal_Create_Concurrently) {
RunCustomTestEpilog(&sd);
}
#ifndef ROCRTST_EMULATOR_BUILD
TEST(rocrtstFunc, DISABLED_Aql_Barrier_Bit_Set) {
AqlBarrierBitTest ab(true, false);
RunCustomTestProlog(&ab);
@@ -361,6 +362,7 @@ TEST(rocrtstStress, DISABLED_Memory_Concurrent_Pool_Info_Test) {
mt.MemoryConcurrentPoolGetInfo();
RunCustomTestEpilog(&mt);
}
#endif // ROCRTST_EMULATOR_BUILD
TEST(rocrtstPerf, ENQUEUE_LATENCY) {
EnqueueLatency singlePacketequeue(true);
EnqueueLatency multiPacketequeue(false);
@@ -109,7 +109,11 @@
#include "hsa/hsa.h"
#include "hsa/hsa_ext_finalize.h"
#ifdef ROCRTST_EMULATOR_BUILD
static const uint32_t kNumBufferElements = 4;
#else
static const uint32_t kNumBufferElements = 256;
#endif
#define RET_IF_HSA_ERR(err) { \
if ((err) != HSA_STATUS_SUCCESS) { \