
The patch implements header-only support for testure lookups. The patch has been tested on a source file with all possible combinations of argument types supported by CUDA headers, compiled and verified that the generated instructions and their parameters match the code generated by NVCC. Unfortunately, compiling texture code requires CUDA headers and can't be tested in clang itself. The test will need to be added to the test-suite later. While generated code compiles and seems to match NVCC, I do not have any code that uses textures that I could test correctness of the implementation. Hence the experimental status. Differential Revision: https://reviews.llvm.org/D110089
14 lines
690 B
Plaintext
14 lines
690 B
Plaintext
// REQUIRES: x86-registered-target
|
|
// REQUIRES: nvptx-registered-target
|
|
//
|
|
// RUN: %clang -std=c++11 -fsyntax-only -target x86_64-linux -nocudainc -nocudalib --cuda-gpu-arch=sm_86 --cuda-device-only -S %s
|
|
// RUN: %clang -std=c++11 -fsyntax-only -target x86_64-linux -nocudainc -nocudalib --cuda-gpu-arch=sm_86 --cuda-host-only -S %s
|
|
|
|
// Define bare minimum required for parsing the header file.
|
|
#include "Inputs/include/cuda.h"
|
|
|
|
// The header file is expected to compile w/o errors. This ensures that texture
|
|
// ID hash has no collisions for known texture operations, otherwise the
|
|
// compilation would fail with an attempt to redefine a type.
|
|
#include <__clang_cuda_texture_intrinsics.h>
|