Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXSWHTEC-114 - Implement tests for hipExtLaunchKernel APIs #60

Closed
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cea96af
SWDEV-355313 - Move catch tests and samples
gargrahul Oct 26, 2022
909e7e4
SWDEV-355313 - Add README
gargrahul Nov 7, 2022
094b9af
SWDEV-355313 - Update amd-staging branch
gargrahul Nov 28, 2022
9daa6d0
SWDEV-355313 - Update README
gargrahul Dec 2, 2022
c49043e
SWDEV-355313 - Update latest code
gargrahul Dec 6, 2022
98fdac0
EXSWHTEC-94 - Add resource guards and utils for 2D/3D allocations and…
nives-vukovic Dec 7, 2022
12e34b9
Merge remote-tracking branch 'origin/develop' into utils
nives-vukovic Dec 9, 2022
15614ba
EXSWHTEC-94 - Extend stream guard and add guards for multiple events …
nives-vukovic Dec 9, 2022
ef2294c
EXSWHTEC-107 - Implement tests for Execution Control setter APIs
mirza-halilcevic Dec 9, 2022
cb576ff
Merge remote-tracking branch 'origin/utils' into hipFuncGetAttributes…
mirza-halilcevic Dec 9, 2022
2e8acdd
EXSWHTEC-108 - Implement tests for hipFuncGetAttributes
mirza-halilcevic Dec 9, 2022
1a9d4fc
EXSWHTEC-115 - Implement tests for hipLaunchCooperativeKernel APIs
mirza-halilcevic Dec 9, 2022
c5e5ebf
EXSWHTEC-114 - Implement tests for hipExtLaunchKernel APIs
mirza-halilcevic Dec 9, 2022
211dc60
EXSWHTEC-107 - Disable tests on corresponding platform.
mirza-halilcevic Dec 13, 2022
0382acd
Merge remote-tracking branch 'origin/execution_control_setter_tests' …
mirza-halilcevic Dec 13, 2022
5134c87
Merge remote-tracking branch 'origin/hipFuncGetAttributes_tests' into…
mirza-halilcevic Dec 13, 2022
fcf4481
Merge remote-tracking branch 'origin/hipLaunchCooperativeKernel_tests…
mirza-halilcevic Dec 13, 2022
d4ff201
EXSWHTEC-107 - Disable failing tests on AMD.
mirza-halilcevic Dec 13, 2022
33f7ebb
EXSWHTEC-108 - Disable failing tests on AMD.
mirza-halilcevic Dec 13, 2022
febe218
EXSWHTEC-114 - Disable failing tests on AMD.
mirza-halilcevic Dec 13, 2022
aa9f777
Merge remote-tracking branch 'upstream/develop' into execution_contro…
mirza-halilcevic Dec 18, 2022
5ce5535
Merge remote-tracking branch 'origin/execution_control_setter_tests' …
mirza-halilcevic Dec 18, 2022
7bab468
Merge remote-tracking branch 'origin/hipFuncGetAttributes_tests' into…
mirza-halilcevic Dec 18, 2022
355747e
Merge remote-tracking branch 'origin/hipLaunchCooperativeKernel_tests…
mirza-halilcevic Dec 18, 2022
c67fb82
Add defect issue numbers.
mirza-halilcevic Dec 18, 2022
d6884ce
EXSWHTEC-108 - Disable test in corresponding json config instead of
mirza-halilcevic Mar 7, 2023
e0649d9
Merge remote-tracking branch 'origin/hipFuncGetAttributes_tests' into…
mirza-halilcevic Mar 20, 2023
928e874
EXSWHTEC-108 - Disable test case in json due to defect.
mirza-halilcevic Mar 20, 2023
d5a36a0
Merge remote-tracking branch 'origin/hipFuncGetAttributes_tests' into…
mirza-halilcevic Mar 20, 2023
cfd07f6
Merge remote-tracking branch 'origin/hipLaunchCooperativeKernel_tests…
mirza-halilcevic Mar 20, 2023
5918cbc
EXSWHTEC-114 - Disable test case in json due to defect.
mirza-halilcevic Mar 20, 2023
ec22bef
EXSWHTEC-114 - Disable test case in json due to defect.
mirza-halilcevic Mar 20, 2023
1bcc42d
Merge remote-tracking branch 'origin/develop' into execution_control_…
mirza-halilcevic Jun 28, 2023
b6d282a
Merge remote-tracking branch 'origin/develop' into hipFuncGetAttribut…
mirza-halilcevic Jun 28, 2023
8de532d
Merge remote-tracking branch 'origin/develop' into hipLaunchCooperati…
mirza-halilcevic Jun 28, 2023
3754b10
Merge remote-tracking branch 'origin/develop' into hipExtLaunchKernel…
mirza-halilcevic Jun 28, 2023
fb18a9c
Merge branch 'develop' into execution_control_setter_tests
rakesroy Jun 28, 2023
2cc6317
Merge branch 'develop' into hipFuncGetAttributes_tests
rakesroy Jun 28, 2023
f1b160e
Merge branch 'develop' into hipLaunchCooperativeKernel_tests
rakesroy Jun 28, 2023
04415c4
Merge branch 'develop' into hipExtLaunchKernel_tests
rakesroy Jun 28, 2023
4f44f1e
Merge branch 'develop' into execution_control_setter_tests
rakesroy Jun 28, 2023
ec58c11
Merge branch 'develop' into hipFuncGetAttributes_tests
rakesroy Jun 28, 2023
597676c
Merge remote-tracking branch 'origin/develop' into execution_control_…
mirza-halilcevic Dec 18, 2023
0d4be25
Merge remote-tracking branch 'upstream/develop' into execution_contro…
mirza-halilcevic Dec 18, 2023
9ddf844
Merge remote-tracking branch 'origin/execution_control_setter_tests' …
mirza-halilcevic Dec 18, 2023
b63682a
Merge remote-tracking branch 'origin/hipFuncGetAttributes_tests' into…
mirza-halilcevic Dec 18, 2023
0462aa0
Merge remote-tracking branch 'origin/hipLaunchCooperativeKernel_tests…
mirza-halilcevic Dec 18, 2023
2f7c5c0
Merge branch 'develop' into hipExtLaunchKernel_tests
mirza-halilcevic Dec 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion catch/hipTestMain/config/config_amd_linux_common.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
"Unit_hipInit_Negative",
"Unit_hipMemset_Negative_OutOfBoundsPtr",
"Unit_hipDeviceReset_Positive_Basic",
"Unit_hipDeviceReset_Positive_Threaded"
"Unit_hipDeviceReset_Positive_Threaded",
"Unit_hipFuncSetCacheConfig_Positive_Basic",
"Unit_hipFuncSetCacheConfig_Negative_Parameters",
"Unit_hipFuncSetSharedMemConfig_Positive_Basic",
"Unit_hipFuncSetSharedMemConfig_Negative_Parameters",
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout",
"Unit_hipFuncSetAttribute_Positive_Parameters",
"Unit_hipFuncSetAttribute_Negative_Parameters",
"NOTE: The following 4 tests are disabled due to defect - EXSWHTEC-240",
"Unit_hipFuncSetCacheConfig_Negative_Not_Supported",
"Unit_hipFuncSetSharedMemConfig_Negative_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported"
]
}
15 changes: 14 additions & 1 deletion catch/hipTestMain/config/config_amd_windows_common.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@
"Note: needs to be enabled when streamPerThread issues are fixed",
"Unit_hipStreamSynchronize_NullStreamAndStreamPerThread",
"Note: intermittent Seg fault failure ",
"Unit_hipGraphAddEventRecordNode_Functional_WithoutFlags"
"Unit_hipGraphAddEventRecordNode_Functional_WithoutFlags",
"Unit_hipFuncSetCacheConfig_Positive_Basic",
"Unit_hipFuncSetCacheConfig_Negative_Parameters",
"Unit_hipFuncSetSharedMemConfig_Positive_Basic",
"Unit_hipFuncSetSharedMemConfig_Negative_Parameters",
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout",
"Unit_hipFuncSetAttribute_Positive_Parameters",
"Unit_hipFuncSetAttribute_Negative_Parameters",
"NOTE: The following 4 tests are disabled due to defect - EXSWHTEC-240",
"Unit_hipFuncSetCacheConfig_Negative_Not_Supported",
"Unit_hipFuncSetSharedMemConfig_Negative_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported"
]
}
9 changes: 9 additions & 0 deletions catch/hipTestMain/config/config_nvidia_linux_common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DisabledTests":
[
"Unit_hipFuncSetCacheConfig_Negative_Not_Supported",
"Unit_hipFuncSetSharedMemConfig_Negative_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported"
]
}
9 changes: 9 additions & 0 deletions catch/hipTestMain/config/config_nvidia_windows_common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DisabledTests":
[
"Unit_hipFuncSetCacheConfig_Negative_Not_Supported",
"Unit_hipFuncSetSharedMemConfig_Negative_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported"
]
}
57 changes: 55 additions & 2 deletions catch/include/resource_guards.hh
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ template <typename T> class DrvArrayAllocGuard {
const hipExtent extent_;
};

enum class Streams { nullstream, perThread, created };
enum class Streams { nullstream, perThread, created, withFlags, withPriority };

class StreamGuard {
public:
StreamGuard(const Streams stream_type) : stream_type_{stream_type} {
StreamGuard(const Streams stream_type, unsigned int flags = hipStreamDefault, int priority = 0) : stream_type_{stream_type}, flags_{flags}, priority_{priority} {
switch (stream_type_) {
case Streams::nullstream:
stream_ = nullptr;
Expand All @@ -210,6 +210,11 @@ class StreamGuard {
break;
case Streams::created:
HIP_CHECK(hipStreamCreate(&stream_));
break;
case Streams::withFlags:
HIP_CHECK(hipStreamCreateWithFlags(&stream_, flags_));
case Streams::withPriority:
HIP_CHECK(hipStreamCreateWithPriority(&stream_, flags_, priority_));
}
}

Expand All @@ -226,5 +231,53 @@ class StreamGuard {

private:
const Streams stream_type_;
unsigned int flags_;
int priority_;
hipStream_t stream_;
};

class EventsGuard {
public:
EventsGuard(size_t N) : events_(N) {
for (auto &e : events_) HIP_CHECK(hipEventCreate(&e));
}

EventsGuard(const EventsGuard&) = delete;
EventsGuard(EventsGuard&&) = delete;

~EventsGuard() {
for (auto &e : events_) static_cast<void>(hipEventDestroy(e));
}

hipEvent_t& operator[](int index) { return events_[index]; }

operator hipEvent_t() const { return events_.at(0); }

std::vector<hipEvent_t>& event_list() { return events_; }

private:
std::vector<hipEvent_t> events_;
};

class StreamsGuard {
public:
StreamsGuard(size_t N) : streams_(N) {
for (auto &s : streams_) HIP_CHECK(hipStreamCreate(&s));
}

StreamsGuard(const StreamsGuard&) = delete;
StreamsGuard(StreamsGuard&&) = delete;

~StreamsGuard() {
for (auto &s : streams_) static_cast<void>(hipStreamDestroy(s));
}

hipStream_t& operator[](int index) { return streams_[index]; }

operator hipStream_t() const { return streams_.at(0); }

std::vector<hipStream_t>& stream_list() { return streams_; }

private:
std::vector<hipStream_t> streams_;
};
6 changes: 6 additions & 0 deletions catch/include/utils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,9 @@ inline bool DeviceAttributesSupport(const int device, Attributes... attributes)
};
return (... && DeviceAttributeSupport(device, attributes));
}

inline int GetDeviceAttribute(const hipDeviceAttribute_t attr, int device) {
int value = 0;
HIP_CHECK(hipDeviceGetAttribute(&value, attr, device));
return value;
}
1 change: 1 addition & 0 deletions catch/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ add_subdirectory(cooperativeGrps)
#if(HIP_PLATFORM STREQUAL "amd")
#add_subdirectory(clock)
#endif()
add_subdirectory(executionControl)
21 changes: 21 additions & 0 deletions catch/unit/executionControl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set(TEST_SRC
execution_control_common.cc
hipFuncSetCacheConfig.cc
hipFuncSetSharedMemConfig.cc
hipFuncSetAttribute.cc
hipFuncGetAttributes.cc
hipLaunchCooperativeKernel.cc
hipLaunchCooperativeKernelMultiDevice.cc
)

if(HIP_PLATFORM MATCHES "amd")
set(TEST_SRC ${TEST_SRC}
hipExtLaunchKernel.cc
hipExtLaunchMultiKernelMultiDevice.cc
)
endif()

hip_add_exe_to_target(NAME ExecutionControlTest
TEST_SRC ${TEST_SRC}
TEST_TARGET_NAME build_tests
COMPILE_OPTIONS -std=c++17)
37 changes: 37 additions & 0 deletions catch/unit/executionControl/execution_control_common.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#include "execution_control_common.hh"

#include <hip_test_common.hh>
#include <hip/hip_cooperative_groups.h>

__global__ void kernel() {}

__global__ void kernel2() {}

__global__ void kernel_42(int* val) { *val = 42; }

__global__ void coop_kernel() {
cooperative_groups::grid_group grid = cooperative_groups::this_grid();
grid.sync();
}
31 changes: 31 additions & 0 deletions catch/unit/executionControl/execution_control_common.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#pragma once

__global__ void kernel();

__global__ void kernel2();

__global__ void kernel_42(int* val);

__global__ void coop_kernel();
Loading