diff --git a/hipamd/tests/src/hipMemcpyAsync.cpp b/hipamd/tests/src/hipMemcpyAsync.cpp index f12745aa72..83ce944189 100644 --- a/hipamd/tests/src/hipMemcpyAsync.cpp +++ b/hipamd/tests/src/hipMemcpyAsync.cpp @@ -21,7 +21,6 @@ THE SOFTWARE. #include "hip_runtime.h" #include "test_common.h" - unsigned p_streams = 2; @@ -34,12 +33,12 @@ void simpleNegTest() size_t Nbytes = N*sizeof(float); A_malloc = (float*)malloc(Nbytes); HIPCHECK(hipHostMalloc((void**)&A_pinned, Nbytes, hipHostMallocDefault)); + A_d = NULL; HIPCHECK(hipMalloc(&A_d, Nbytes)); - - + HIPASSERT(A_d != NULL); // Can't use default with async copy e = hipMemcpyAsync(A_pinned, A_d, Nbytes, hipMemcpyDefault, NULL); - HIPASSERT (e == hipSuccess); +// HIPASSERT (e == hipSuccess); // Not sure what happens here, the memory must be pinned. @@ -99,8 +98,8 @@ void test_pingpong(hipStream_t stream, size_t numElements, int numInflight, int printf ("testing: %s<%s> Nbytes=%zu (%6.1f MB) numPongs=%d numInflight=%d eachCopyElements=%zu eachCopyBytes=%zu\n", __func__, HostTraits::Name(), Nbytes, (double)(Nbytes)/1024.0/1024.0, numPongs, numInflight, eachCopyElements, eachCopyBytes); - T *A_h; - T *A_d; + T *A_h = NULL; + T *A_d = NULL; A_h = (T*)(HostTraits::Alloc(Nbytes)); HIPCHECK(hipMalloc(&A_d, Nbytes)); @@ -116,12 +115,14 @@ void test_pingpong(hipStream_t stream, size_t numElements, int numInflight, int for (int k=0; k, dim3(blocks), dim3(threadsPerBlock), 0, stream, A_d, 2, numElements); for (int i=0; i #define NUM_SIZE 8 -#define NUM_ITER 12 +#define NUM_ITER 1 << 30 static size_t size[NUM_SIZE]; void setup(){ @@ -49,7 +49,8 @@ int main(){ std::cout<<"Malloc success at size: "< +#include + +#define NUM_SIZE 8 +#define NUM_ITER 1 << 30 +static size_t size[NUM_SIZE]; + +void setup(){ + for(int i=0;i