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-70 - Reimplement tests for hipMemPrefetchAsync #3004

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
41844f2
Cit -m RAII guards for memory allocations and streams, define some co…
music-dino Sep 30, 2022
858da0e
Implement helper function for generating allocation flags
music-dino Oct 3, 2022
899b91f
Implement helper function DeviceAttributesSupport to check if a devic…
music-dino Oct 4, 2022
8accf0c
EXSWHTEC-70 - Reimplement tests for hipMemPrefetchAsync
music-dino Oct 4, 2022
94aa6b4
EXSWHTEC-70 - Reimplement tests for hipMemPrefetchAsync
music-dino Oct 4, 2022
e534d2e
EXSWHTEC-94 - Implement helper classes and functions for memory tests
music-dino Oct 6, 2022
09ce86a
EXSWHTEC-94 - Remove c++14 standard constraint on memory tests
music-dino Oct 6, 2022
5010c69
Merge branch 'utils' into hipMemPrefetchAsync_tests
music-dino Oct 6, 2022
48b337f
EXSWHTEC-94 - Remove GenerateLinearAllocationFlagCombinations until f…
music-dino Oct 6, 2022
2d3b7a7
Merge branch 'develop' into utils
music-dino Oct 8, 2022
715cf30
EXSWHTEC-94 - Implement helper classes and functions for memory tests
music-dino Oct 6, 2022
a74fe21
EXSWHTEC-94 - Remove c++14 standard constraint on memory tests
music-dino Oct 6, 2022
350958e
EXSWHTEC-94 - Remove GenerateLinearAllocationFlagCombinations until f…
music-dino Oct 6, 2022
ea6689c
Merge branch 'develop' into utils
music-dino Oct 10, 2022
2a44046
Merge remote-tracking branch 'origin/utils' into utils
mirza-halilcevic Oct 10, 2022
691d00e
EXSWHTEC-94 - Implement helper classes and functions for memory tests
music-dino Oct 6, 2022
7bdf52f
EXSWHTEC-94 - Remove c++14 standard constraint on memory tests
music-dino Oct 6, 2022
1185c39
EXSWHTEC-94 - Remove GenerateLinearAllocationFlagCombinations until f…
music-dino Oct 6, 2022
8d2e833
Merge remote-tracking branch 'origin/utils' into utils
music-dino Oct 11, 2022
e003c4f
Merge remote-tracking branch 'origin/utils' into utils
mirza-halilcevic Oct 12, 2022
8911eb7
EXSWHTEC-94 - Implement resource guards for hipMallocPitch and 3D
mirza-halilcevic Oct 12, 2022
b1a68bd
Merge remote-tracking branch 'origin/utils' into utils
music-dino Oct 14, 2022
76c8e31
EXSWHTEC-94 - Add resource guards for 2D and 3D allocations and utils…
music-dino Oct 14, 2022
35f373e
Merge remote-tracking branch 'upstream/develop' into utils
music-dino Oct 14, 2022
eede07b
Merge branch 'utils' into hipMemPrefetchAsync_tests
music-dino Oct 17, 2022
7734178
EXSWHTEC-94 - Implement resource guards for arrays.
mirza-halilcevic Oct 18, 2022
25679d8
Merge remote-tracking branch 'upstream/develop' into utils
mirza-halilcevic Oct 18, 2022
1fd1cb0
EXSWHTEC-94 - Add hip_array_common.hh.
mirza-halilcevic Oct 18, 2022
fc3a107
EXSWHTEC-94 - Remove redundancies between hip_array_common.hh and
mirza-halilcevic Oct 18, 2022
5dc3c7b
Merge branch 'develop' into hipMemPrefetchAsync_tests
music-dino Nov 3, 2022
995d5c3
Merge remote-tracking branch 'upstream/develop' into utils
music-dino Nov 4, 2022
4e2fe8d
EXSWHTEC-94 - Fix loop counter types in PitchedMemoryVerify and Pitch…
music-dino Nov 4, 2022
302ea3b
Merge remote-tracking branch 'origin/utils' into hipMemPrefetchAsync_…
music-dino Nov 4, 2022
bd7e720
Disable dev_ptr points to non-managed memory section due to defect
music-dino Nov 4, 2022
5572cf4
Merge branch 'develop' into hipMemPrefetchAsync_tests
mangupta Nov 14, 2022
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
Prev Previous commit
Next Next commit
Implement helper function DeviceAttributesSupport to check if a devic…
…e supports any number of attributes
  • Loading branch information
music-dino committed Oct 4, 2022
commit 899b91f978a97f2cd4a082d71d8517bd74461ad9
13 changes: 12 additions & 1 deletion tests/catch/include/utils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inline constexpr size_t kPageSize = 4096;
} // anonymous namespace

template <typename T>
void MemcpyArrayCompare(T* const expected, T* const actual, const size_t num_elements) {
void ArrayMismatch(T* const expected, T* const actual, const size_t num_elements) {
const auto ret = std::mismatch(expected, expected + num_elements, actual);
if (ret.first != expected + num_elements) {
const auto idx = std::distance(expected, ret.first);
Expand Down Expand Up @@ -84,4 +84,15 @@ inline void LaunchDelayKernel(const std::chrono::milliseconds interval, const hi
// Clock rate is in kHz => number of clock ticks in a millisecond
HIP_CHECK(hipDeviceGetAttribute(&ticks_per_ms, hipDeviceAttributeClockRate, 0));
Delay<<<1, 1, 0, stream>>>(interval.count(), ticks_per_ms);
}

template <typename... Attributes>
inline bool DeviceAttributesSupport(const int device, Attributes... attributes) {
constexpr auto DeviceAttributeSupport = [](const int device,
const hipDeviceAttribute_t attribute) {
int value = 0;
HIP_CHECK(hipDeviceGetAttribute(&value, attribute, device));
return value;
};
return (... && DeviceAttributeSupport(device, attributes));
}