Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
1 change: 1 addition & 0 deletions basic_features_freeze.csv
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ L0_CTS_zeCommandListEventTests_GivenMemorySetThatSignalsEventWhenCompleteWhenExe
L0_CTS_zeCommandListEventTests_GivenMemoryCopyRegionThatSignalsEventWhenCompleteWhenExecutingCommandListThenHostAndGpuReadEventCorrectly,--gtest_filter=zeCommandListEventTests.GivenMemoryCopyRegionThatSignalsEventWhenCompleteWhenExecutingCommandListThenHostAndGpuReadEventCorrectly,test_copy,basic,Core,Events
L0_CTS_VaryPatternSize_zeCommandListAppendMemoryFillPatternVerificationTests_GivenPatternSizeWhenExecutingAMemoryFillThenMemoryIsSetCorrectly,--gtest_filter=VaryPatternSize/zeCommandListAppendMemoryFillPatternVerificationTests.GivenPatternSizeWhenExecutingAMemoryFillThenMemoryIsSetCorrectly/*,test_copy,basic,Core,Device Memory
L0_CTS_MemoryCopies_zeCommandListAppendMemoryCopyRegionWithDataVerificationParameterizedTests_GivenValidMemoryWhenAppendingMemoryCopyWithRegionThenSuccessIsReturnedAndCopyIsCorrect,--gtest_filter=MemoryCopies/zeCommandListAppendMemoryCopyRegionWithDataVerificationParameterizedTests.GivenValidMemoryWhenAppendingMemoryCopyWithRegionThenSuccessIsReturnedAndCopyIsCorrect/*,test_copy,basic,Core,Device Memory
L0_CTS_ParameterizedTests_zeCommandListAppendMemoryBackToBackTests_GivenUsmAndSharedSystemUsmConfirmSuccessfulExecutionBackToBackAllPermutations,--gtest_filter=ParameterizedTests/zeCommandListAppendMemoryBackToBackTests.GivenUsmAndSharedSystemUsmConfirmSuccessfulExecutionBackToBackAllPermutations/*,test_copy,basic,Core,Device Memory
65 changes: 65 additions & 0 deletions conformance_tests/core/test_copy/src/test_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,71 @@ LZT_TEST_F(
RunGivenDeviceMemoryToDeviceMemoryAndSizeWhenAppendingMemoryCopyTest(true);
}

class zeCommandListAppendMemoryBackToBackTests
: public ::testing::Test,
public ::testing::WithParamInterface<
std::tuple<bool, bool, bool, bool, size_t>> {

protected:
void RunGivenCopyBetweenUsmAndSharedSystemUsmAndVerifyCorrect(
bool is_src_shared_system, bool is_dst_shared_system, bool is_immediate,
bool isCopyOnly, size_t size) {
const uint8_t value = (rand()) & 0xFF;
const uint8_t init = (value + 0x22) & 0xFF;

void *src_memory = lzt::allocate_shared_memory_with_allocator_selector(
size, is_src_shared_system);
void *dst_memory = lzt::allocate_shared_memory_with_allocator_selector(
size, is_dst_shared_system);

uint32_t ordinal = 0;
if (isCopyOnly) {
ordinal = 1;
}

const char *src_memory_type = is_src_shared_system ? "SVM" : "USM";
const char *dst_memory_type = is_dst_shared_system ? "SVM" : "USM";

printf("src_memory (%s)= %p dst_memory (%s)= %p immediate = %d isCopyOnly "
"= %d size = %ld\n",
src_memory_type, src_memory, dst_memory_type, dst_memory,
is_immediate, isCopyOnly, size);

memset(src_memory, value, size);
memset(dst_memory, init, size);

auto cmd_bundle = lzt::create_command_bundle(
lzt::get_default_context(), zeDevice::get_instance()->get_device(), 0,
ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0,
ordinal, 0, is_immediate);

lzt::append_memory_copy(cmd_bundle.list, static_cast<void *>(dst_memory),
static_cast<void *>(src_memory), size);

lzt::close_command_list(cmd_bundle.list);
lzt::execute_and_sync_command_bundle(cmd_bundle, UINT64_MAX);
EXPECT_EQ(0, memcmp(src_memory, dst_memory, size));

free_memory_with_allocator_selector(src_memory, is_src_shared_system);
free_memory_with_allocator_selector(dst_memory, is_dst_shared_system);
}
};

LZT_TEST_P(
zeCommandListAppendMemoryBackToBackTests,
GivenUsmAndSharedSystemUsmConfirmSuccessfulExecutionBackToBackAllPermutations) {
SKIP_IF_SHARED_SYSTEM_ALLOC_UNSUPPORTED();
RunGivenCopyBetweenUsmAndSharedSystemUsmAndVerifyCorrect(
std::get<0>(GetParam()), std::get<1>(GetParam()), std::get<2>(GetParam()),
std::get<3>(GetParam()), std::get<4>(GetParam()));
}

INSTANTIATE_TEST_SUITE_P(
ParameterizedTests, zeCommandListAppendMemoryBackToBackTests,
::testing::Combine(::testing::Bool(), ::testing::Bool(), ::testing::Bool(),
::testing::Bool(),
::testing::Values(10, 10 * 1024, 32 * 1024 * 1024)));

class zeCommandListAppendMemoryCopyFromContextWithDataVerificationTests
: public zeCommandListCommandQueueTests {
protected:
Expand Down
Loading