This patch adds some machinery to the build system to make it
possible to leverage a cross compiler for binding generation. It
also updates the documentation to remove the requirement of a native
compiler in the cross-compilation case.
cuda_api_host.gpr was the only place where support for the CUDA_ROOT
environment variable was missing. This patch adds that support, and
with that it becomes possible to build the examples with a CUDA installation
that does not live in /usr/local/cuda.
Issue: eng/toolchain/cuda#32
Before this patch, there were a few things missing for things
to work when setting the cuda_host environment variable to aarch64-linux.
This patch adds the missing bits.
Without quoting, the check behaves correctly. However, when
there is more than one file (or filename with space) it
throws a useless error message.
This reverts commit 80859a0a5647bd4f70aed6a123462e0426989fec.
The device-side thick bindings are not usable at the moment, and they
tend to break with each new version of CUDA that NVIDIA releases.
This patch unhooks the generation of these bindings from `setup.sh`.
The uwrap files are left in the tree in the hope that they will be
fixed later.
A recent change added a UWrap rule to handle preprocessor macros
introduced in CUDA 12.0. Unfortunately, that change broke the
samples with CUDA 11.0.
This patch modifies the UWrap rule to have a much tighter scope.
Instead of trying to handle the general pattern of function
versioning used in upstream CUDA headers, it's now specifically
about the specific function that causes problem with our samples
and CUDA 12.0, cudaGetDeviceProperties.
Starting with CUDA 12.0, cuda_runtime_api.h defines
cudaGetDeviceProperties as a macro that expands to
cudaGetDeviceProperties_v2. That macro is not handled by
`gcc -fdump-ada-spec`.
This patch adds a UWrap rule that makes it so that the thick
bindings expose a Get_Device_Properties function that calls the
"_v2" version internally, just like the upstream C header does.
For now, we need to duplicate most of the file contents. UWrap
doesn't allow for easy modularization of user files. As we're
looking at moving these files to a different tool, it's not worth
fixing at this stage.