-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sycl-upstream' into ur-cmdbuf-cmdlist-bump
- Loading branch information
Showing
96 changed files
with
3,299 additions
and
3,612 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
/// | ||
/// Perform several driver tests for SYCL -Xarch_device/host on Linux | ||
/// | ||
|
||
// UNSUPPORTED: system-windows | ||
|
||
/// ########################################################################### | ||
|
||
/// test behavior of -Xarch_device with 1 option for SYCL compiler, the flag | ||
/// should be passed to device compilation only. | ||
// RUN: %clangxx -fsycl %s -Xarch_device -fsanitize=address -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_DEVICE_OPTION | ||
// RUN: %clangxx -fsycl %s -Xarch_device -fsanitize=address -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_DEVICE_ONLY | ||
// SYCL_XARCH_DEVICE_OPTION: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_DEVICE_OPTION-SAME: -fsanitize=address | ||
// SYCL_XARCH_DEVICE_OPTION-SAME: -fsanitize-address-use-after-return=never | ||
// SYCL_XARCH_DEVICE_OPTION-SAME: -fno-sanitize-address-use-after-scope | ||
// SYCL_XARCH_DEVICE_OPTION-SAME: "-mllvm" "-asan-instrumentation-with-call-threshold=0" | ||
// SYCL_XARCH_DEVICE_OPTION-SAME: "-mllvm" "-asan-stack=0" | ||
// SYCL_XARCH_DEVICE_OPTION-SAME: "-mllvm" "-asan-globals=0" | ||
// SYCL_XARCH_DEVICE_ONLY: llc{{.*}} "-filetype=obj" | ||
// SYCL_XARCH_DEVICE_ONLY-NOT: fsanitize=address | ||
|
||
/// test behavior of -Xarch_device with multiple options for SYCL compiler, the | ||
/// flags should be passed to device compilation only. | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -DXARCH_DEVICE_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_DEVICE_OPTIONS1 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -DXARCH_DEVICE_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_DEVICE_OPTIONS1 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -DXARCH_DEVICE_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_DEVICE_OPTIONS2 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -DXARCH_DEVICE_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_DEVICE_OPTIONS3 | ||
// SYCL_XARCH_DEVICE_OPTIONS1: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_DEVICE_OPTIONS1-SAME: -fsanitize=address | ||
// SYCL_XARCH_DEVICE_OPTIONS1-SAME: -fsanitize-address-use-after-return=never | ||
// SYCL_XARCH_DEVICE_OPTIONS1-SAME: -fno-sanitize-address-use-after-scope | ||
// SYCL_XARCH_DEVICE_OPTIONS1-SAME: "-mllvm" "-asan-instrumentation-with-call-threshold=0" | ||
// SYCL_XARCH_DEVICE_OPTIONS1-SAME: "-mllvm" "-asan-stack=0" | ||
// SYCL_XARCH_DEVICE_OPTIONS1-SAME: "-mllvm" "-asan-globals=0" | ||
// SYCL_XARCH_DEVICE_OPTIONS2: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_DEVICE_OPTIONS2-SAME: XARCH_DEVICE_TEST | ||
// SYCL_XARCH_DEVICE_OPTIONS3: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_DEVICE_OPTIONS3-SAME: "-mllvm" "-enable-merge-functions" | ||
|
||
|
||
/// test behavior of -Xarch_host with 1 option for SYCL compiler, the flag | ||
/// should be passed to host compilation only. | ||
// RUN: %clangxx -fsycl %s -Xarch_host -fsanitize=address -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_OPTION | ||
// RUN: %clangxx -fsycl %s -Xarch_host -fsanitize=address -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_ONLY | ||
// SYCL_XARCH_HOST_OPTION: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_OPTION-SAME: -fsanitize=address | ||
// SYCL_XARCH_HOST_OPTION-SAME: -fsanitize-address-use-after-scope | ||
// SYCL_XARCH_HOST_OPTION-NEXT: libclang_rt.asan | ||
// SYCL_XARCH_HOST_ONLY: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_HOST_ONLY-NOT: -fsanitize=address | ||
// SYCL_XARCH_HOST_ONLY: clang{{.*}} "-fsycl-is-host" | ||
|
||
/// test behavior of -Xarch_host with multiple options for SYCL compiler, the | ||
/// flags should be passed to host compilation only. | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -DXARCH_HOST_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_OPTIONS1 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -DXARCH_HOST_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_OPTIONS2 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -DXARCH_HOST_TEST -mllvm -enable-merge-functions" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_OPTIONS3 | ||
// SYCL_XARCH_HOST_OPTIONS1: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_OPTIONS1-SAME: -fsanitize=address | ||
// SYCL_XARCH_HOST_OPTIONS1-SAME: -fsanitize-address-use-after-scope | ||
// SYCL_XARCH_HOST_OPTIONS2: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_OPTIONS2-SAME: XARCH_HOST_TEST | ||
// SYCL_XARCH_HOST_OPTIONS3: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_OPTIONS3-SAME: "-mllvm" "-enable-merge-functions" | ||
|
||
// test behavior of combination of -Xarch_device and -Xarch_device. | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_DEVICE_OPTIONS1 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_DEVICE_OPTIONS2 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_NO_DEVICE | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_HOST_OPTIONS1 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_HOST_OPTIONS2 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_HOST_OPTIONS3 | ||
// RUN: %clangxx -fsycl %s -Xarch_device "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host "-fsanitize=memory -DUSE_XARCH_HOST -fno-builtin" -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_COM_NO_HOST | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1-SAME: -fsanitize=address | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1-SAME: -fsanitize-address-use-after-return=never | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1-SAME: -fno-sanitize-address-use-after-scope | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1-SAME: "-mllvm" "-asan-instrumentation-with-call-threshold=0" | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1-SAME: "-mllvm" "-asan-stack=0" | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS1-SAME: "-mllvm" "-asan-globals=0" | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS2: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_COM_DEVICE_OPTIONS2-SAME: "-mllvm" "-enable-merge-functions" | ||
// SYCL_XARCH_COM_NO_DEVICE: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_COM_NO_DEVICE-NOT: USE_XARCH_HOST | ||
// SYCL_XARCH_COM_NO_DEVICE: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_COM_HOST_OPTIONS1: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_COM_HOST_OPTIONS1-SAME: -fsanitize=memory | ||
// SYCL_XARCH_COM_HOST_OPTIONS1-NEXT: libclang_rt.msan | ||
// SYCL_XARCH_COM_HOST_OPTIONS2: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_COM_HOST_OPTIONS2-SAME: USE_XARCH_HOST | ||
// SYCL_XARCH_COM_HOST_OPTIONS3: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_COM_HOST_OPTIONS3-SAME: -fno-builtin | ||
// SYCL_XARCH_COM_NO_HOST: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_COM_NO_HOST-NOT: "-mllvm" "-enable-merge-functions" | ||
|
||
|
||
// test behavior of multiple usage of -Xarch_host in single command line | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_MULTIPLE1 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_MULTIPLE2 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_MULTIPLE3 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_HOST_MULTIPLE4 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_NO_DEVICE_MULTIPLE1 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_NO_DEVICE_MULTIPLE2 | ||
// RUN: %clangxx -fsycl %s -Xarch_host "-fsanitize=address -mllvm -enable-merge-functions" \ | ||
// RUN: -Xarch_host -DFOO -Xarch_host -DFOO1 -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=SYCL_XARCH_NO_DEVICE_MULTIPLE3 | ||
// SYCL_XARCH_HOST_MULTIPLE1: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_MULTIPLE1-SAME: -fsanitize=address | ||
// SYCL_XARCH_HOST_MULTIPLE1-NEXT: libclang_rt.asan | ||
// SYCL_XARCH_HOST_MULTIPLE2: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_MULTIPLE2-SAME: "-mllvm" "-enable-merge-functions" | ||
// SYCL_XARCH_HOST_MULTIPLE3: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_MULTIPLE3-SAME: "FOO" | ||
// SYCL_XARCH_HOST_MULTIPLE4: clang{{.*}} "-fsycl-is-host" | ||
// SYCL_XARCH_HOST_MULTIPLE4-SAME: "FOO1" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE1: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE1-NOT: -fsanitize=address | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE1: llc{{.*}} "-filetype=obj" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE2: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE2-NOT: "-mllvm" "-enable-merge-functions" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE2: llc{{.*}} "-filetype=obj" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE3: clang{{.*}} "-fsycl-is-device" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE3-NOT: "FOO" | ||
// SYCL_XARCH_NO_DEVICE_MULTIPLE3: llc{{.*}} "-filetype=obj" |
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,58 @@ | ||
//==-- device-sanitizer-report.hpp - Structure and declaration for assert | ||
// support --==// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
#pragma once | ||
|
||
// Treat this header as system one to workaround frontend's restriction | ||
#pragma clang system_header | ||
|
||
#include <cinttypes> | ||
|
||
enum class DeviceSanitizerErrorType : int32_t { | ||
UNKNOWN, | ||
OUT_OF_BOUND, | ||
MISALIGNED, | ||
USE_AFTER_FREE, | ||
OUT_OF_SHADOW_BOUND, | ||
}; | ||
|
||
enum class DeviceSanitizerMemoryType : int32_t { | ||
UNKNOWN, | ||
USM_DEVICE, | ||
USM_HOST, | ||
USM_SHARED, | ||
LOCAL, | ||
PRIVATE, | ||
MEM_BUFFER, | ||
}; | ||
|
||
// NOTE Layout of this structure should be aligned with the one in | ||
// sycl/include/sycl/detail/device_sanitizer_report.hpp | ||
struct DeviceSanitizerReport { | ||
int Flag = 0; | ||
|
||
char File[256 + 1] = ""; | ||
char Func[256 + 1] = ""; | ||
|
||
int32_t Line = 0; | ||
|
||
uint64_t GID0 = 0; | ||
uint64_t GID1 = 0; | ||
uint64_t GID2 = 0; | ||
|
||
uint64_t LID0 = 0; | ||
uint64_t LID1 = 0; | ||
uint64_t LID2 = 0; | ||
|
||
bool IsWrite = false; | ||
uint32_t AccessSize = 0; | ||
DeviceSanitizerMemoryType MemoryType = DeviceSanitizerMemoryType::UNKNOWN; | ||
DeviceSanitizerErrorType ErrorType = DeviceSanitizerErrorType::UNKNOWN; | ||
|
||
bool IsRecover = false; | ||
}; |
Oops, something went wrong.