[PATCH] D18051: [CUDA] Provide CUDA's vector types implemented using clang's vector extension.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 10 10:42:34 PST 2016


tra created this revision.
tra added reviewers: jlebar, jingyue.
tra added a subscriber: cfe-commits.

This provides substantial performance boost on some benchmarks
(~25% on SHOC's FFT) due to vectorized loads/stores.

Unfortunately existing CUDA headers and user code occasionally
take pointer to vector fields which clang does not allow, so
we can't use vector types by default.

While vectorized types help in some cases, they may lower
performance in cases when user reads/writes only part of the vector as
Clang currently generates code to always load/store complete vector.
It may also create data races if user code assumed that parts of the
same vector can be safely changed from different threads.

For now control this feature via -DCUDA_VECTOR_TYPES and let user
choose whether to use Clang's vectorized types or CUDA's
non-vectorized ones.

http://reviews.llvm.org/D18051

Files:
  lib/Headers/CMakeLists.txt
  lib/Headers/__clang_cuda_runtime_wrapper.h
  lib/Headers/__clang_cuda_vector_types.h
  lib/Headers/cuda_builtin_vars.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18051.50301.patch
Type: text/x-patch
Size: 6650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160310/6bbd8794/attachment-0001.bin>


More information about the cfe-commits mailing list