diff --git a/hipamd/tests/src/runtimeApi/memory/hipMemcpy.cpp b/hipamd/tests/src/runtimeApi/memory/hipMemcpy.cpp index ad798d70c1..c48f780e44 100644 --- a/hipamd/tests/src/runtimeApi/memory/hipMemcpy.cpp +++ b/hipamd/tests/src/runtimeApi/memory/hipMemcpy.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 * RUN_NAMED: %t hipMemcpy-modes --tests 0x1 * RUN_NAMED: %t hipMemcpy-size --tests 0x6 - * RUN_NAMED: %t hipMemcpy-offsets --tests 0x10 + * RUN_NAMED: %t hipMemcpy-dev_offsets --tests 0x10 * RUN_NAMED: %t hipMemcpy-multithreaded --tests 0x8 * HIT_END */ @@ -335,7 +335,7 @@ void memcpytest2_offsets(size_t maxElem) memcpytest2(&memD, &memP, elem, 1, 1, 0); // pinned host } - for (int offset=512; offset < maxElem; offset*=2) { + for (int offset=512; offset < elem; offset*=2) { assert (elem + offset < maxElem); memD.offset(offset); memcpytest2(&memD, &memU, elem, 1, 1, 0); // unpinned host @@ -427,13 +427,6 @@ int main(int argc, char *argv[]) } - if (p_tests & 0x10) { - printf ("\n\n=== tests&4 (test offsets)\n"); - HIPCHECK ( hipDeviceReset() ); - memcpytest2_offsets(256*1024*1024); - memcpytest2_offsets(256*1024*1024); - memcpytest2_offsets(256*1024*1024); - } if (p_tests & 0x8) { printf ("\n\n=== tests&8\n"); @@ -456,6 +449,16 @@ int main(int argc, char *argv[]) } + if (p_tests & 0x10) { + printf ("\n\n=== tests&0x10 (test device offsets)\n"); + HIPCHECK ( hipDeviceReset() ); + size_t maxSize = 256*1024; + memcpytest2_offsets (maxSize); + memcpytest2_offsets (maxSize); + memcpytest2_offsets(maxSize); + } + + passed();