Make hipMemset*Async* tests pass in static lib

3 hipMemset*Async* direct tests will crash in static lib because
some hsa objects are not initialized when hip apis call them.
The fix will make the hip apis called in main() so that hsa objects
have been initialized at that stage.

Change-Id: I41eb29b8c2588acac0cd3ae6d96b14fb1abd235a
This commit is contained in:
Tao Sang
2020-11-02 09:39:56 -05:00
کامیت شده توسط Tao Sang
والد b0664a0087
کامیت 272f89a966
3فایلهای تغییر یافته به همراه14 افزوده شده و 7 حذف شده
@@ -23,7 +23,7 @@
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_LIB_TYPE static
* BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t
* HIT_END
*/
@@ -32,7 +32,7 @@
#define ITER 10
#define N 1024 * 1024
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
unsigned blocks = 0;
template <typename T>
__global__ void vector_square(T* B_d, T* C_d, size_t M) {
@@ -153,6 +153,9 @@ bool testhipMemsetD8AsyncWithKernel() {
int main() {
bool testResult = true;
int numDevices = 0;
blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
printf("blocks: %u\n", blocks);
HIPCHECK(hipGetDeviceCount(&numDevices));
printf("total number of gpus in the system: %d\n", numDevices);