Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][L0] Use compute engine for memory fill command #1273

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Changes from all 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
25 changes: 25 additions & 0 deletions SYCL/Plugin/level_zero_memory_fill.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// REQUIRES: gpu, level_zero, level_zero_dev_kit
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER
// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_FILL=0 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER

// Check that the fill operation is using compute (0 ordinal) engine.
//
// CHECK: [getZeQueue]: create queue ordinal = 0
// CHECKL ZE ---> zeCommandListAppendMemoryFill

#include <iostream>
#include <sycl/sycl.hpp>

using namespace sycl;

const int N = 1024;

int main() {
auto Q = queue(gpu_selector_v);
auto p = malloc_device(N, Q);
Q.memset(p, 1, N).wait();
sycl::free(p, Q);

return 0;
}