Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/transcoding/enqueue_marker.cl

raw
1 // RUN: %clang_cc1 -triple spir-unknown-unknown -fdeclare-opencl-builtins -finclude-default-header -O0 -cl-std=CL2.0 -emit-llvm-bc %s -o %t.bc -no-opaque-pointers
2 // RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text -o %t.spv.txt
3 // RUN: FileCheck < %t.spv.txt %s --check-prefix=CHECK-SPIRV
4 // RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv
5 // RUN: spirv-val %t.spv
6 // RUN: llvm-spirv -r %t.spv -o %t.rev.bc
7 // RUN: llvm-dis -opaque-pointers=0 %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM
8 // RUN: llvm-spirv -r -spirv-target-env="SPV-IR" %t.spv -o %t.rev.bc
9 // RUN: llvm-dis -opaque-pointers=0 %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-SPV-IR
10
11 // Check that SPIR-V friendly IR is correctly recognized
12 // RUN: llvm-spirv %t.rev.bc -spirv-text -o %t.spv.txt
13 // RUN: FileCheck < %t.spv.txt %s --check-prefix=CHECK-SPIRV
14
15 kernel void test_enqueue_marker(global int *out) {
16 queue_t queue = get_default_queue();
17
18 clk_event_t waitlist, evt;
19
20 // CHECK-SPIRV: EnqueueMarker
21 // CHECK-LLVM: _Z14enqueue_marker9ocl_queuejPU3AS4K12ocl_clkeventPU3AS4S0_
22 // CHECK-SPV-IR: call spir_func %spirv.Queue* @_Z23__spirv_GetDefaultQueuev()
23 // CHECK-SPV-IR: call spir_func i32 @_Z21__spirv_EnqueueMarkerP13__spirv_QueuejPU3AS4P19__spirv_DeviceEventS4_(%spirv.Queue* %0, i32 1, %spirv.DeviceEvent* addrspace(4)* %waitlist.ascast, %spirv.DeviceEvent* addrspace(4)* %evt.ascast)
24 *out = enqueue_marker(queue, 1, &waitlist, &evt);
25 }