diff --git a/projects/clr/hipamd/tests/src/hipMemcpyAsync.cpp b/projects/clr/hipamd/tests/src/hipMemcpyAsync.cpp index 6192940270..19f1a94761 100644 --- a/projects/clr/hipamd/tests/src/hipMemcpyAsync.cpp +++ b/projects/clr/hipamd/tests/src/hipMemcpyAsync.cpp @@ -20,7 +20,8 @@ void simpleNegTest() // Can't use default with async copy e = hipMemcpyAsync(A_pinned, A_d, Nbytes, hipMemcpyDefault, NULL); - HIPASSERT (e==hipErrorInvalidMemcpyDirection); + HIPASSERT (e==hipErrorInvalidMemcpyDirection); // TODO + HIPASSERT (e!= hipSuccess); // Not sure what happens here, the memory must be pinned. @@ -30,6 +31,33 @@ void simpleNegTest() //HIPASSERT (e==hipErrorInvalidValue); } + +//--- +//Send many async copies to the same stream. +//This requires runtime to keep track of many outstanding commands, and in the case of HCC requires growing/tracking the signal pool: +template +void test_manyCopies(int nElements, size_t numCopies, int nStreams) +{ + size_t Nbytes = nElements*sizeof(T); + printf ("Nbytes=%zu (%6.1f MB)\n", Nbytes, (double)(Nbytes)/1024.0/1024.0); + + int *A_d, *B_d, *C_d; + int *A_h, *B_h, *C_h; + + HipTest::initArrays (&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, true); + + size_t eachCopyBytes = Nbytes / numCopies; + + for (size_t i=0; i