Skip to content

Commit

Permalink
fixed UR FileCheck conditions to match call entrance only
Browse files Browse the repository at this point in the history
makes llvm work with this change: oneapi-src/unified-runtime#2101
fixes this bug: oneapi-src/unified-runtime#2002
  • Loading branch information
lslusarczyk committed Sep 20, 2024
1 parent 97dba84 commit 15faf1a
Show file tree
Hide file tree
Showing 25 changed files with 136 additions and 136 deletions.
4 changes: 2 additions & 2 deletions sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ if(SYCL_UR_USE_FETCH_CONTENT)
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
endfunction()

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
set(UNIFIED_RUNTIME_REPO "https://github.com/lslusarczyk/unified-runtime.git")
# commit 185149248dd257bd37482aac43307a136204c051
# Merge: 2af159d4 d619bcd1
# Author: Piotr Balcer <[email protected]>
# Date: Thu Sep 19 11:02:27 2024 +0200
# Merge pull request #1934 from yingcong-wu/yc/0806-exclude-shadow-from-coredump
# [DeviceSanitizer] Exclude shadow memory from coredump file for CPU device.
set(UNIFIED_RUNTIME_TAG 185149248dd257bd37482aac43307a136204c051)
set(UNIFIED_RUNTIME_TAG 2d10f85bb08e092a716c1a32828fa1104cc5508a)

set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main() {
Q.submit([&](handler &Cgh) {
// Now that we have a read-write host allocation, check that the native
// buffer is created with the UR_MEM_FLAG_USE_HOST_POINTER flag.
// CHECK: urMemBufferCreate
// CHECK: -> urMemBufferCreate
// CHECK-SAME: UR_MEM_FLAG_USE_HOST_POINTER
auto BufAcc = Buf.get_access<access::mode::read>(Cgh);
Cgh.single_task<Foo>([=]() { int A = BufAcc[0]; });
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Basic/buffer/subbuffer_overlap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ int main() {
for (auto &e : sycl::host_accessor{b})
e = idx++ % size;

// CHECK: urMemBufferPartition
// CHECK: -> urMemBufferPartition
// CHECK: .origin = 256, .size = 64
q.submit([&](sycl::handler &cgh) {
sycl::accessor acc{sub1, cgh};
cgh.parallel_for(size, [=](auto id) { acc[id] += 1; });
});
// CHECK: urMemBufferPartition
// CHECK: -> urMemBufferPartition
// CHECK: .origin = 256, .size = 128
q.submit([&](sycl::handler &cgh) {
sycl::accessor acc{sub2, cgh};
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Basic/event_release.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ int main() {
// Buffer destruction triggers execution graph cleanup, check that both
// events (one for launching the kernel and one for memory transfer to host)
// are released.
// CHECK: urEventRelease
// CHECK: urEventRelease
// CHECK: -> urEventRelease
// CHECK: -> urEventRelease
assert(Val == Gold);
// CHECK: End of main scope
std::cout << "End of main scope" << std::endl;
Expand Down
14 changes: 7 additions & 7 deletions sycl/test-e2e/Basic/fill_accessor_ur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ int main() {
}

// CHECK: start testFill_Buffer1D
// CHECK: urEnqueueMemBufferFill
// CHECK: -> urEnqueueMemBufferFill
// CHECK: start testFill_Buffer1D -- OFFSET
// CHECK: urEnqueueMemBufferFill
// CHECK: -> urEnqueueMemBufferFill

// CHECK: start testFill_Buffer2D
// CHECK: urEnqueueMemBufferFill
// CHECK: -> urEnqueueMemBufferFill
// CHECK: start testFill_Buffer2D -- OFFSET
// CHECK: urEnqueueKernelLaunch
// CHECK: -> urEnqueueKernelLaunch

// CHECK: start testFill_Buffer3D
// CHECK: urEnqueueMemBufferFill
// CHECK: -> urEnqueueMemBufferFill
// CHECK: start testFill_Buffer3D -- OFFSET
// CHECK: urEnqueueKernelLaunch
// CHECK: -> urEnqueueKernelLaunch

// CHECK: start testFill_ZeroDim
// CHECK: urEnqueueMemBufferFill
// CHECK: -> urEnqueueMemBufferFill
8 changes: 4 additions & 4 deletions sycl/test-e2e/DeviceCodeSplit/grf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ int main(void) {

// CHECK: ---> urKernelCreate({{.*}}SingleGRF{{.*}}-> UR_RESULT_SUCCESS

// CHECK-NO-VAR: urProgramBuild{{.*}}-ze-opt-large-register-file
// CHECK-WITH-VAR: urProgramBuild{{.*}}-g -ze-opt-large-register-file
// CHECK-AUTO-NO-VAR: urProgramBuild{{.*}}-ze-intel-enable-auto-large-GRF-mode
// CHECK-AUTO-WITH-VAR: urProgramBuild{{.*}}-g -ze-intel-enable-auto-large-GRF-mode
// CHECK-NO-VAR: -> urProgramBuild{{.*}}-ze-opt-large-register-file
// CHECK-WITH-VAR: -> urProgramBuild{{.*}}-g -ze-opt-large-register-file
// CHECK-AUTO-NO-VAR: -> urProgramBuild{{.*}}-ze-intel-enable-auto-large-GRF-mode
// CHECK-AUTO-WITH-VAR: -> urProgramBuild{{.*}}-g -ze-intel-enable-auto-large-GRF-mode
// CHECK-SAME: -> UR_RESULT_SUCCESS

// CHECK: ---> urKernelCreate({{.*}}SpecifiedGRF{{.*}}-> UR_RESULT_SUCCESS
4 changes: 2 additions & 2 deletions sycl/test-e2e/Graph/Explicit/memadvise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
// impact results but only performances, we verify
// that a node is correctly added by checking UR function calls.

// CHECK: urCommandBufferAppendUSMAdviseExp
// CHECK: -> urCommandBufferAppendUSMAdviseExp
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER:]]
// CHECK-SAME: .pMemory = 0x[[#%x,PTR:]]
// CHECK-SAME: .size = 400
// CHECK-SAME: .pSyncPoint = {{.*}} (0x[[#%x,ADVISE_SYNC_POINT:]])
// CHECK-SAME: -> UR_RESULT_SUCCESS

// CHECK: urCommandBufferAppendKernelLaunchExp(
// CHECK: -> urCommandBufferAppendKernelLaunchExp(
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER]]
// CHECK-SAME: .hKernel = 0x[[#%x,KERNEL:]]
// CHECK-SAME: .workDim = 1
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Graph/Explicit/prefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// impact results but only performances, we verify
// that a node is correctly added by checking UR function calls

// CHECK: urCommandBufferAppendUSMPrefetchExp(
// CHECK: -> urCommandBufferAppendUSMPrefetchExp(
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER:]]
// CHECK-SAME: .pMemory = 0x[[#%x,PTR:]]
// CHECK-SAME: .size = 400
// CHECK-SAME: .pSyncPoint = {{.*}} (0x[[#%x,PREFETCH_SYNC_POINT:]])

// CHECK: urCommandBufferAppendKernelLaunchExp(
// CHECK: -> urCommandBufferAppendKernelLaunchExp(
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER]]
// CHECK-SAME: .hKernel = 0x[[#%x,KERNEL:]]
// CHECK-SAME: .workDim = 1
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Graph/RecordReplay/memadvise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// impact results but only performances, we verify
// that a node is correctly added by checking UR function calls.

// CHECK: urCommandBufferAppendUSMAdviseExp
// CHECK: -> urCommandBufferAppendUSMAdviseExp
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER:]]
// CHECK-SAME: .pMemory = 0x[[#%x,PTR:]]
// CHECK-SAME: .size = 400
// CHECK-SAME: .pSyncPoint = {{.*}} (0x[[#%x,ADVISE_SYNC_POINT:]])

// CHECK: urCommandBufferAppendKernelLaunchExp(
// CHECK: -> urCommandBufferAppendKernelLaunchExp(
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER]]
// CHECK-SAME: .hKernel = 0x[[#%x,KERNEL:]]
// CHECK-SAME: .workDim = 1
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Graph/RecordReplay/prefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// impact results but only performances, we verify
// that a node is correctly added by checking UR function calls

// CHECK: urCommandBufferAppendUSMPrefetchExp(
// CHECK: -> urCommandBufferAppendUSMPrefetchExp(
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER:]]
// CHECK-SAME: .pMemory = 0x[[#%x,PTR:]]
// CHECK-SAME: .size = 400
// CHECK-SAME: .pSyncPoint = {{.*}} (0x[[#%x,PREFETCH_SYNC_POINT:]])

// CHECK: urCommandBufferAppendKernelLaunchExp(
// CHECK: -> urCommandBufferAppendKernelLaunchExp(
// CHECK-SAME: .hCommandBuffer = 0x[[#%x,COMMAND_BUFFER]]
// CHECK-SAME: .hKernel = 0x[[#%x,KERNEL:]]
// CHECK-SAME: .workDim = 1
Expand Down
12 changes: 6 additions & 6 deletions sycl/test-e2e/KernelAndProgram/cache_env_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
// Some backends will call urProgramBuild and some will call
// urProgramBuildExp depending on urProgramBuildExp support.

// CHECK-BUILD-NOT: urProgramCreateWithBinary(
// CHECK-BUILD: urProgramCreateWithIL(
// CHECK-BUILD: urProgramBuild{{(Exp)?}}(
// CHECK-BUILD-NOT: -> urProgramCreateWithBinary(
// CHECK-BUILD: -> urProgramCreateWithIL(
// CHECK-BUILD: -> urProgramBuild{{(Exp)?}}(

// CHECK-CACHE-NOT: urProgramCreateWithIL(
// CHECK-CACHE: urProgramCreateWithBinary(
// CHECK-CACHE: urProgramBuild{{(Exp)?}}(
// CHECK-CACHE-NOT: -> urProgramCreateWithIL(
// CHECK-CACHE: -> urProgramCreateWithBinary(
// CHECK-CACHE: -> urProgramBuild{{(Exp)?}}(

#include "cache_env_vars.hpp"
12 changes: 6 additions & 6 deletions sycl/test-e2e/KernelAndProgram/cache_env_vars_lin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

// Some backends will call urProgramBuild and some will call urProgramBuildExp depending on urProgramBuildExp support.

// CHECK-BUILD-NOT: urProgramCreateWithBinary(
// CHECK-BUILD: urProgramCreateWithIL(
// CHECK-BUILD: urProgramBuild{{(Exp)?}}(
// CHECK-BUILD-NOT: -> urProgramCreateWithBinary(
// CHECK-BUILD: -> urProgramCreateWithIL(
// CHECK-BUILD: -> urProgramBuild{{(Exp)?}}(

// CHECK-CACHE-NOT: urProgramCreateWithIL(
// CHECK-CACHE: urProgramCreateWithBinary(
// CHECK-CACHE: urProgramBuild{{(Exp)?}}(
// CHECK-CACHE-NOT: -> urProgramCreateWithIL(
// CHECK-CACHE: -> urProgramCreateWithBinary(
// CHECK-CACHE: -> urProgramBuild{{(Exp)?}}(

#include "cache_env_vars.hpp"
12 changes: 6 additions & 6 deletions sycl/test-e2e/KernelAndProgram/cache_env_vars_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
// RUN: env SYCL_CACHE_PERSISTENT=1 AppData=%t/cache_dir SYCL_UR_TRACE=2 env -u SYCL_CACHE_DIR %t.out | FileCheck %s --check-prefixes=CHECK-BUILD
// RUN: env SYCL_CACHE_PERSISTENT=1 AppData=%t/cache_dir SYCL_UR_TRACE=2 env -u SYCL_CACHE_DIR %t.out | FileCheck %s --check-prefixes=CHECK-CACHE

// CHECK-BUILD-NOT: urProgramCreateWithBinary(
// CHECK-BUILD: urProgramCreateWithIL(
// CHECK-BUILD: urProgramBuild{{(Exp)?}}(
// CHECK-BUILD-NOT: -> urProgramCreateWithBinary(
// CHECK-BUILD: -> urProgramCreateWithIL(
// CHECK-BUILD: -> urProgramBuild{{(Exp)?}}(

// CHECK-CACHE-NOT: urProgramCreateWithIL(
// CHECK-CACHE: urProgramCreateWithBinary(
// CHECK-CACHE: urProgramBuild{{(Exp)?}}(
// CHECK-CACHE-NOT: -> urProgramCreateWithIL(
// CHECK-CACHE: -> urProgramCreateWithBinary(
// CHECK-CACHE: -> urProgramBuild{{(Exp)?}}(

#include "cache_env_vars.hpp"
120 changes: 60 additions & 60 deletions sycl/test-e2e/KernelAndProgram/disable-caching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,66 +21,66 @@ constexpr specialization_id<int> spec_id;

int main() {
queue q;
// CHECK: urProgramCreate
// CHECK-NOT: urProgramRetain
// CHECK: urKernelCreate
// CHECK-NOT: urKernelRetain
// CHECK: urEnqueueKernelLaunch
// CHECK: urKernelRelease
// CHECK: urProgramRelease
// CHECK: urEventWait
// CHECK: -> urProgramCreate
// CHECK-NOT: -> urProgramRetain
// CHECK: -> urKernelCreate
// CHECK-NOT: -> urKernelRetain
// CHECK: -> urEnqueueKernelLaunch
// CHECK: -> urKernelRelease
// CHECK: -> urProgramRelease
// CHECK: -> urEventWait

// CHECK-CACHE: urProgramCreate
// CHECK-CACHE: urProgramRetain
// CHECK-CACHE-NOT: urProgramRetain
// CHECK-CACHE: urKernelCreate
// CHECK-CACHE: urKernelRetain
// CHECK-CACHE-NOT: urKernelCreate
// CHECK-CACHE: urEnqueueKernelLaunch
// CHECK-CACHE: urKernelRelease
// CHECK-CACHE: urProgramRelease
// CHECK-CACHE: urEventWait
// CHECK-CACHE: -> urProgramCreate
// CHECK-CACHE: -> urProgramRetain
// CHECK-CACHE-NOT: -> urProgramRetain
// CHECK-CACHE: -> urKernelCreate
// CHECK-CACHE: -> urKernelRetain
// CHECK-CACHE-NOT: -> urKernelCreate
// CHECK-CACHE: -> urEnqueueKernelLaunch
// CHECK-CACHE: -> urKernelRelease
// CHECK-CACHE: -> urProgramRelease
// CHECK-CACHE: -> urEventWait
q.single_task([] {}).wait();

// CHECK: urProgramCreate
// CHECK-NOT: urProgramRetain
// CHECK: urKernelCreate
// CHECK-NOT: urKernelRetain
// CHECK: urEnqueueKernelLaunch
// CHECK: urKernelRelease
// CHECK: urProgramRelease
// CHECK: urEventWait
// CHECK: -> urProgramCreate
// CHECK-NOT: -> urProgramRetain
// CHECK: -> urKernelCreate
// CHECK-NOT: -> urKernelRetain
// CHECK: -> urEnqueueKernelLaunch
// CHECK: -> urKernelRelease
// CHECK: -> urProgramRelease
// CHECK: -> urEventWait

// CHECK-CACHE: urProgramCreate
// CHECK-CACHE: urProgramRetain
// CHECK-CACHE-NOT: urProgramRetain
// CHECK-CACHE: urKernelCreate
// CHECK-CACHE: urKernelRetain
// CHECK-CACHE-NOT: urKernelCreate
// CHECK-CACHE: urEnqueueKernelLaunch
// CHECK-CACHE: urKernelRelease
// CHECK-CACHE: urProgramRelease
// CHECK-CACHE: urEventWait
// CHECK-CACHE: -> urProgramCreate
// CHECK-CACHE: -> urProgramRetain
// CHECK-CACHE-NOT: -> urProgramRetain
// CHECK-CACHE: -> urKernelCreate
// CHECK-CACHE: -> urKernelRetain
// CHECK-CACHE-NOT: -> urKernelCreate
// CHECK-CACHE: -> urEnqueueKernelLaunch
// CHECK-CACHE: -> urKernelRelease
// CHECK-CACHE: -> urProgramRelease
// CHECK-CACHE: -> urEventWait

// CHECK: urProgramCreate
// CHECK-NOT: urProgramRetain
// CHECK: urKernelCreate
// CHECK-NOT: urKernelRetain
// CHECK: urEnqueueKernelLaunch
// CHECK: urKernelRelease
// CHECK: urProgramRelease
// CHECK: urEventWait
// CHECK: -> urProgramCreate
// CHECK-NOT: -> urProgramRetain
// CHECK: -> urKernelCreate
// CHECK-NOT: -> urKernelRetain
// CHECK: -> urEnqueueKernelLaunch
// CHECK: -> urKernelRelease
// CHECK: -> urProgramRelease
// CHECK: -> urEventWait

// CHECK-CACHE: urProgramCreate
// CHECK-CACHE: urProgramRetain
// CHECK-CACHE-NOT: urProgramRetain
// CHECK-CACHE: urKernelCreate
// CHECK-CACHE: urKernelRetain
// CHECK-CACHE-NOT: urKernelCreate
// CHECK-CACHE: urEnqueueKernelLaunch
// CHECK-CACHE: urKernelRelease
// CHECK-CACHE: urProgramRelease
// CHECK-CACHE: urEventWait
// CHECK-CACHE: -> urProgramCreate
// CHECK-CACHE: -> urProgramRetain
// CHECK-CACHE-NOT: -> urProgramRetain
// CHECK-CACHE: -> urKernelCreate
// CHECK-CACHE: -> urKernelRetain
// CHECK-CACHE-NOT: -> urKernelCreate
// CHECK-CACHE: -> urEnqueueKernelLaunch
// CHECK-CACHE: -> urKernelRelease
// CHECK-CACHE: -> urProgramRelease
// CHECK-CACHE: -> urEventWait
auto *p = malloc_device<int>(1, q);
for (int i = 0; i < 2; ++i)
q.submit([&](handler &cgh) {
Expand All @@ -94,9 +94,9 @@ int main() {
}

// (Program cache releases)
// CHECK-CACHE: urKernelRelease
// CHECK-CACHE: urKernelRelease
// CHECK-CACHE: urKernelRelease
// CHECK-CACHE: urProgramRelease
// CHECK-CACHE: urProgramRelease
// CHECK-CACHE: urProgramRelease
// CHECK-CACHE: -> urKernelRelease
// CHECK-CACHE: -> urKernelRelease
// CHECK-CACHE: -> urKernelRelease
// CHECK-CACHE: -> urProgramRelease
// CHECK-CACHE: -> urProgramRelease
// CHECK-CACHE: -> urProgramRelease
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "kernel-bundle-merge-options.hpp"

// CHECK: urProgramBuild{{.*}}{{[^bar]*}}-DENV_COMPILE_OPTS -DENV_APPEND_COMPILE_OPTS{{[^bar]*}}-DENV_LINK_OPTS -DENV_APPEND_LINK_OPTS{{[^bar]*}}
// CHECK: -> urProgramBuild{{.*}}{{[^bar]*}}-DENV_COMPILE_OPTS -DENV_APPEND_COMPILE_OPTS{{[^bar]*}}-DENV_LINK_OPTS -DENV_APPEND_LINK_OPTS{{[^bar]*}}

// CHECK: urProgramCompile{{.*}}{{[^bar]*}}-DENV_COMPILE_OPTS -DENV_APPEND_COMPILE_OPTS{{[^bar]*}}
// CHECK: -> urProgramCompile{{.*}}{{[^bar]*}}-DENV_COMPILE_OPTS -DENV_APPEND_COMPILE_OPTS{{[^bar]*}}

// CHECK: urProgramLink{{.*}}{{[^bar]*}}-DENV_LINK_OPTS -DENV_APPEND_LINK_OPTS{{[^bar]*}}
// CHECK: -> urProgramLink{{.*}}{{[^bar]*}}-DENV_LINK_OPTS -DENV_APPEND_LINK_OPTS{{[^bar]*}}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

#include "kernel-bundle-merge-options.hpp"

// CHECK: urProgramBuild
// CHECK: -> urProgramBuild
// CHECK-SAME: -g

// TODO: Uncomment when build options are properly passed to compile and link
// commands for kernel_bundle
// xCHECK: urProgramCompile(
// xCHECK: -> urProgramCompile(
// xCHECK-SAME: -g
// xCHECK: urProgramLink(
// xCHECK: -> urProgramLink(
// xCHECK-SAME: -g
2 changes: 1 addition & 1 deletion sycl/test-e2e/Plugin/level_zero_batch_event_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// CHECK: ZE ---> zeCommandListClose
// CHECK: ZE ---> zeCommandQueueExecuteCommandLists
// CHECK: ---> urEventGetInfo
// CHECK-NOT: urEventsWait
// CHECK-NOT: -> urEventsWait
// CHECK: ---> urEnqueueKernelLaunch
// CHECK: ZE ---> zeCommandListAppendLaunchKernel
// CHECK: ---> urQueueFinish
Expand Down
Loading

0 comments on commit 15faf1a

Please sign in to comment.