-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCLomatic] Enable migration of implicit sync behavior between defau…
…lt stream and other stream (#2567) Add new value for option: -use-experimental-features=in_order_queue_events to apply SYCL feature: in order queue events during migration (ref to https://github.com/intel/llvm/blob/ca955e538171cb7b7eb07734dd5c2b958c84901c/sycl/doc/extensions/experimental/sycl_ext_oneapi_in_order_queue_events.asciidoc) Signed-off-by: intwanghao <hao3.wang@intel.com>
- Loading branch information
1 parent
b3b0ed5
commit d236fce
Showing
6 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// RUN: dpct --format-range=none --use-experimental-features=in_order_queue_events -out-root %T/kernel_implicit_sync %s --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only | ||
// RUN: FileCheck %s --match-full-lines --input-file %T/kernel_implicit_sync/kernel_implicit_sync.dp.cpp | ||
// RUN: %if build_lit %{icpx -c -fsycl %T/kernel_implicit_sync/kernel_implicit_sync.dp.cpp -o %T/kernel_implicit_sync/kernel_implicit_sync.dp.o %} | ||
#include<cuda_runtime.h> | ||
|
||
__global__ void kernel(int *a){ | ||
|
||
} | ||
|
||
int main() { | ||
int *a, *b; | ||
cudaStream_t s1; | ||
cudaStreamCreate(&s1); | ||
cudaMallocManaged(&a, 100); | ||
cudaMallocManaged(&b, 100); | ||
|
||
// CHECK: q_ct1.submit( | ||
// CHECK: [&](sycl::handler &cgh) { | ||
// CHECK: cgh.depends_on(dpct::get_current_device().get_in_order_queues_last_events()); | ||
// CHECK: cgh.parallel_for( | ||
// CHECK: sycl::nd_range<3>(sycl::range<3>(1, 1, 1), sycl::range<3>(1, 1, 1)), | ||
// CHECK: [=](sycl::nd_item<3> item_ct1) { | ||
// CHECK: kernel(a); | ||
// CHECK: }); | ||
// CHECK: }); | ||
kernel<<<1,1>>>(a); | ||
|
||
// CHECK: s1->submit( | ||
// CHECK: [&](sycl::handler &cgh) { | ||
// CHECK: cgh.depends_on(dpct::get_default_queue().ext_oneapi_get_last_event()); | ||
// CHECK: cgh.parallel_for( | ||
// CHECK: sycl::nd_range<3>(sycl::range<3>(1, 1, 1), sycl::range<3>(1, 1, 1)), | ||
// CHECK: [=](sycl::nd_item<3> item_ct1) { | ||
// CHECK: kernel(b); | ||
// CHECK: }); | ||
// CHECK: }); | ||
kernel<<<1, 1, 0, s1>>>(b); | ||
|
||
return 0; | ||
} |