Skip to content

Commit

Permalink
EXSWHTEC-217 - Implement new and update existing tests for the hipGra…
Browse files Browse the repository at this point in the history
…ph*MemcpyNode family of APIs #48

Change-Id: Iae7ac9c855ba6e3288257e99e49f8b16cebb1bac
  • Loading branch information
mirza-halilcevic authored and rakesroy committed Feb 19, 2024
1 parent 9a3fd8e commit cefbaed
Show file tree
Hide file tree
Showing 13 changed files with 2,060 additions and 1,128 deletions.
1 change: 1 addition & 0 deletions catch/hipTestMain/config/config_amd_linux
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"Unit_deviceAllocation_InOneThread_AccessInAllThreads",
"=== Patch which removes the typetraits implementation from std namespace in hiprtc is reverted ===",
"Unit_hiprtc_stdheaders",
"Unit_hipGraphAddMemcpyNode_Negative_Parameters",
"Unit_hipMemAddressFree_negative",
"Unit_hipMemAddressReserve_AlignmentTest",
"Unit_hipMemAddressReserve_Negative",
Expand Down
1 change: 1 addition & 0 deletions catch/hipTestMain/config/config_amd_windows
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
"=== Patch which removes the typetraits implementation from std namespace in hiprtc is reverted ===",
"Unit_hiprtc_stdheaders",
"Unit_hipMemAddressReserve_AlignmentTest",
"Unit_hipGraphAddMemcpyNode_Negative_Parameters",
"Unit_hipMemCreate_ChkWithKerLaunch",
"Unit_hipMemCreate_MapNonContiguousChunks",
"Unit_hipMemMap_MapPartialPhysicalMem",
Expand Down
6 changes: 3 additions & 3 deletions catch/include/memcpy1d_tests_common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void MemcpyDeviceToDeviceShell(F memcpy_func, const hipStream_t kernel_stream =
int can_access_peer = 0;
HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, src_device, dst_device));
if (!can_access_peer) {
INFO("Peer access cannot be enabled between devices " << src_device << " " << dst_device);
return;
}
HIP_CHECK(hipDeviceEnablePeerAccess(dst_device, 0));
Expand Down Expand Up @@ -168,8 +169,8 @@ void MemcpyDeviceToDeviceShell(F memcpy_func, const hipStream_t kernel_stream =
HIP_CHECK(
hipMemcpy(result.host_ptr(), dst_allocation.ptr(), allocation_size, hipMemcpyDeviceToHost));
if constexpr (enable_peer_access) {
// If we've gotten this far, EnablePeerAccess must have succeeded, so we only need to check this
// condition
// If we've gotten this far, EnablePeerAccess must have succeeded, so we
// only need to check this condition
HIP_CHECK(hipDeviceDisablePeerAccess(dst_device));
}

Expand Down Expand Up @@ -237,7 +238,6 @@ void MemcpySyncBehaviorCheck(F memcpy_func, const bool should_sync,
LaunchDelayKernel(std::chrono::milliseconds{100}, kernel_stream);
HIP_CHECK(memcpy_func());
if (should_sync) {
HIP_CHECK(hipStreamSynchronize(kernel_stream));
HIP_CHECK(hipStreamQuery(kernel_stream));
} else {
HIP_CHECK_ERROR(hipStreamQuery(kernel_stream), hipErrorNotReady);
Expand Down
1 change: 1 addition & 0 deletions catch/include/memcpy3d_tests_common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ THE SOFTWARE.
#pragma once
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
#pragma clang diagnostic ignored "-Wunused-lambda-capture"

#include <variant>

#include <hip_test_common.hh>
Expand Down
4 changes: 4 additions & 0 deletions catch/unit/graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set(TEST_SRC
hipGraph.cc
hipSimpleGraphWithKernel.cc
hipGraphAddMemcpyNode.cc
hipGraphAddMemcpyNode_old.cc
hipGraphClone.cc
hipGraphInstantiateWithFlags.cc
hipGraphAddHostNode.cc
Expand Down Expand Up @@ -72,6 +73,7 @@ set(TEST_SRC
hipGraphEventRecordNodeSetEvent.cc
hipGraphEventWaitNodeGetEvent.cc
hipGraphExecMemcpyNodeSetParams.cc
hipGraphExecMemcpyNodeSetParams_old.cc
hipStreamBeginCapture.cc
hipGraphAddMemcpyNode1D_old.cc
hipGraphAddMemcpyNode1D.cc
Expand Down Expand Up @@ -101,7 +103,9 @@ set(TEST_SRC
hipGraphAddMemsetNode.cc
hipGraphAddKernelNode.cc
hipGraphMemcpyNodeGetParams.cc
hipGraphMemcpyNodeGetParams_old.cc
hipGraphMemcpyNodeSetParams.cc
hipGraphMemcpyNodeSetParams_old.cc
hipGraphKernelNodeGetParams.cc
hipGraphKernelNodeSetParams.cc
hipGraphExecKernelNodeSetParams.cc
Expand Down
Loading

0 comments on commit cefbaed

Please sign in to comment.