Use of undeclared identifier 'tex2D' when compile SYCL code using Interoperability Mode
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
### Describe the bug
I tried to use SYCL's Interoperability Mode to compile sycl code that contains some CUDA API with following command:
```bash
icpx -fsycl -fsycl-targets=nvptx64-nvidia-cuda tex2d.cpp -o tex2d_sycl -I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lcudart
```
everything works fine except it cannot find tex2D.
```bash
error: use of undeclared identifier 'tex2D'
```
### To reproduce
```cpp
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
int main() {
cudaArray_t cuArray;
cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc();
cudaMallocArray(&cuArray, &channelDesc, 2, 2);
cudaTextureObject_t textureObj{0L};
cudaResourceDesc resDesc{};
resDesc.resType = cudaResourceTypeArray;
resDesc.res.array.array = cuArray;
cudaTextureDesc texDesc{};
texDesc.addressMode[0] = cudaAddressModeClamp;
texDesc.addressMode[1] = cudaAddressModeClamp;
texDesc.filterMode = cudaFilterModePoint;
texDesc.normalizedCoords = false;
texDesc.readMode = cudaReadModeElementType;
cudaTextureObject_t tex = cudaCreateTextureObject(&textureObj, &resDesc, &texDesc, nullptr);
float result = tex2D(tex, 0.0f, 0.0f);
return 0;
}
```
### Environment
- OS: Ubuntu 22.04.5 LTS
- Target device and vendor: Nvidia GPU
- DPC++ version: Intel(R) oneAPI DPC++/C++ Compiler 2024.2.0 (2024.2.0.20240602)
- Dependencies version:
NVIDIA-SMI 535.183.06 Driver Version: 535.183.06 CUDA Version: 12.2
Version : CUDA 12.2
Name : NVIDIA CUDA BACKEND
Vendor : NVIDIA Corporation
Devices : 1
Device [#0]:
Type : gpu
Version : 5.2
Name : NVIDIA GeForce GTX 980 Ti
Vendor : NVIDIA Corporation
Driver : CUDA 12.2
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.