-
Notifications
You must be signed in to change notification settings - Fork 822
Expand file tree
/
Copy pathmixed-address-space.cpp
More file actions
42 lines (32 loc) · 1.01 KB
/
mixed-address-space.cpp
File metadata and controls
42 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// This test is written with an aim to check that experimental::printf versions
// for constant and generic address space can be used in the same module.
//
// UNSUPPORTED: target-amd
// FIXME: Drop the test once generic AS support is considered stable and the
// dedicated constant AS overload of printf is removed from the library.
//
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out | FileCheck %s
// CHECK: Constant addrspace literal
// CHECK: Generic addrspace literal
#include <sycl/detail/core.hpp>
#include <sycl/ext/oneapi/experimental/builtins.hpp>
#include "helper.hpp"
#include <cstring>
using namespace sycl;
void test() {
{
FORMAT_STRING(constant_literal) = "Constant addrspace literal\n";
ext::oneapi::experimental::printf(constant_literal);
ext::oneapi::experimental::printf("Generic addrspace literal\n");
}
}
class MixedAddrspaceTest;
int main() {
queue q;
q.submit([](handler &cgh) {
cgh.single_task<MixedAddrspaceTest>([]() { test(); });
});
q.wait();
return 0;
}