test(cuda): run the stub pass through clang's CUDA frontend (host/device call legality, __shared__ rules, <<<>>>); fix qsa variants block_q4_0 packing, de-duplicate native_head_native.cu

- check-cu.py now defaults to clang -x cuda --cuda-host-only with real qualifiers; --plain keeps the C++-only pass.
- qsa_prompt_attention_variants.cu: block_q4_0 under pack(1) as in kv_q4.hpp (cu_pin refreshed).
- native_head_native.cu: orphan copy had __launch_bounds__ before extern "C" __global__ (never nvcc-built); now the sealed twin's text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-10-14 16:56:45 +02:00
co-authored by Claude Sonnet 5.5
parent fd7b2c7b8b
commit 2ab3a8ca48
12 changed files with 444 additions and 498 deletions
File diff suppressed because it is too large Load Diff
@@ -22,10 +22,12 @@
enum { kStepPos = 0, kStepNKv = 1, kStepNBid = 2, kStepWidth = 3, kStepCount = 4 };
constexpr int KV_Q8_GROUP = 64;
constexpr int QK4_0 = 32;
#pragma pack(push, 1) // as in kv_q4.hpp: 1-byte alignment (the V cell addresses are only 2-byte aligned in general)
struct block_q4_0 {
uint16_t d; // fp16 scale
uint8_t qs[QK4_0 / 2]; // element j in the low nibble of qs[j], j + 16 in the high one
};
#pragma pack(pop)
static_assert(sizeof(block_q4_0) == 18, "block_q4_0 must be 18 bytes");
// include/strata/kernels/qsa_decode_attn.hpp QsaAttnPools, only the fields this kernel reads.
struct QsaAttnPools {
+2 -2
View File
@@ -5,8 +5,8 @@
{
"cu": "crates/cuda-driver/src/qsa_prompt_attention_variants.cu",
"cu_pin": {
"sha256": "7a3a9afcc08393086f6077bbe093747ce9cdc9e903a45b6a9368810ec59ad034",
"bytes": 23743
"sha256": "6ee7f0d468a714767f684ebe302cd2e269f68764944dd862ed92a94813c7f1e4",
"bytes": 23880
},
"ptx": "crates/cuda-driver/src/qsa_prompt_attention_variants.ptx",
"flags": [
+15 -5
View File
@@ -100,6 +100,12 @@ def rewrite_asm(text):
pos = end
return ''.join(out)
PRINTF_CALL = re.compile(r'(?<=[;{}):,(])(\s*)printf(\s*\()')
def rewrite_printf(text):
"""clang only lowers device printf when it compiles the device side; a host-only pass sees a call to a host function."""
return PRINTF_CALL.sub(r'\1cuda_stub_printf\2', text)
def rewrite_launches(text):
"""K<<<a, b, c, d>>>(args) -> (cuda_stub_cfg(a, b, c, d), K(args))"""
while True:
@@ -136,18 +142,21 @@ def lint(path):
msgs.append(f'{path}:{n}: error: __shared__ variable with an initializer (nvcc: "initializer not allowed for __shared__ variable")')
return msgs
def check(path, fast_math, keep):
def check(path, fast_math, keep, cuda=True):
inc = []
for d in INCLUDES: inc += ['-I', d]
extra = ['-D__USE_FAST_MATH__=1'] if fast_math else []
pre = subprocess.run(['clang++', '-E', '-x', 'c++', '-include', 'cuda_runtime.h'] + COMMON + extra + inc + [path], capture_output=True, text=True)
lang = ['-x', 'cuda', '--cuda-host-only', '-nocudainc', '-nocudalib'] if cuda else ['-x', 'c++']
pre = subprocess.run(['clang++', '-E'] + lang + ['-include', 'cuda_runtime.h'] + COMMON + extra + inc + [path], capture_output=True, text=True)
if pre.returncode != 0:
return path, False, pre.stderr, 0
src = rewrite_launches(rewrite_asm(pre.stdout))
src = rewrite_asm(pre.stdout)
if cuda: src = rewrite_printf(src)
if not cuda: src = rewrite_launches(src)
fd, tmp = tempfile.mkstemp(suffix='.ii', dir=keep)
os.write(fd, src.encode()); os.close(fd)
try:
r = subprocess.run(['clang++', '-fsyntax-only', '-x', 'c++-cpp-output'] + COMMON + WARN + [tmp], capture_output=True, text=True)
r = subprocess.run(['clang++', '-fsyntax-only'] + (['-x', 'cuda-cpp-output', '--cuda-host-only', '-nocudainc', '-nocudalib'] if cuda else ['-x', 'c++-cpp-output']) + COMMON + WARN + [tmp], capture_output=True, text=True)
finally:
if not keep: os.unlink(tmp)
nwarn = r.stderr.count('warning:')
@@ -160,13 +169,14 @@ def main():
ap.add_argument('-j', type=int, default=os.cpu_count() or 4)
ap.add_argument('-v', action='store_true', help='print diagnostics of passing files too')
ap.add_argument('--fast-math', action='store_true')
ap.add_argument('--plain', action='store_true', help='C++-only pass (qualifiers erased) instead of clang\'s CUDA frontend')
ap.add_argument('--keep', help='directory to keep the rewritten translation units in')
ap.add_argument('--max-errors', type=int, default=12)
a = ap.parse_args()
files = a.files or sorted(os.path.join(SRC, f) for f in os.listdir(SRC) if f.endswith('.cu'))
bad = 0
with concurrent.futures.ThreadPoolExecutor(a.j) as ex:
for path, ok, err, nwarn in ex.map(lambda p: check(os.path.abspath(p), a.fast_math, a.keep), files):
for path, ok, err, nwarn in ex.map(lambda p: check(os.path.abspath(p), a.fast_math, a.keep, not a.plain), files):
name = os.path.relpath(path, ROOT)
if ok:
print(f'ok {name}' + (f' ({nwarn} warnings)' if nwarn else ''))
+6
View File
@@ -1,6 +1,9 @@
// Stub of <cooperative_groups.h>: thread_block / tiled_partition / this_thread_block / reduce.
#pragma once
#include "cuda_stub.h"
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
namespace cooperative_groups {
struct thread_block {
void sync() const; unsigned thread_rank() const; unsigned size() const; dim3 group_index() const; uint3 thread_index() const; dim3 group_dim() const;
@@ -17,3 +20,6 @@ template <class T> struct maximum { T operator()(T a, T b) const { return a > b
template <class T> struct less { T operator()(T a, T b) const { return a < b ? a : b; } };
template <class G, class T, class Op> T reduce(const G&, T v, Op) { return v; }
}
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
+6
View File
@@ -1,6 +1,9 @@
// Stub of <cublas_v2.h>: only the handle and status names ggml-cuda/common.cuh mentions.
#pragma once
#include "cuda_stub.h"
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
typedef void* cublasHandle_t;
typedef int cublasStatus_t;
typedef int cublasComputeType_t;
@@ -11,3 +14,6 @@ cublasStatus_t cublasCreate(cublasHandle_t*);
cublasStatus_t cublasDestroy(cublasHandle_t);
cublasStatus_t cublasSetStream(cublasHandle_t, cudaStream_t);
cublasStatus_t cublasSetMathMode(cublasHandle_t, int);
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
+6
View File
@@ -3,6 +3,9 @@
#include "cuda_stub.h"
#ifndef LELEKA_CUDA_STUB_BF16
#define LELEKA_CUDA_STUB_BF16
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
struct __nv_bfloat16_raw { unsigned short x; };
struct __nv_bfloat162_raw { unsigned short x, y; };
struct __nv_bfloat16 {
@@ -45,4 +48,7 @@ __nv_bfloat16 __hneg(__nv_bfloat16); __nv_bfloat16 __habs(__nv_bfloat16);
__nv_bfloat162 __hadd2(__nv_bfloat162, __nv_bfloat162); __nv_bfloat162 __hmul2(__nv_bfloat162, __nv_bfloat162);
__nv_bfloat162 __hfma2(__nv_bfloat162, __nv_bfloat162, __nv_bfloat162);
struct __nv_bfloat16_raw __nv_cvt_e8m0_to_bf16raw(unsigned char);
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
#endif
+6
View File
@@ -4,6 +4,9 @@
#include "cuda_stub.h"
#ifndef LELEKA_CUDA_STUB_FP16
#define LELEKA_CUDA_STUB_FP16
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
struct __half_raw { unsigned short x; };
struct __half2_raw { unsigned short x, y; };
struct __half {
@@ -96,4 +99,7 @@ __half2 __shfl_sync(unsigned, __half2, int, int = 32);
__half2 __ldg(const __half2*); __half __ldg(const __half*);
void atomicAdd(__half*, __half);
__half2 atomicAdd(__half2*, __half2);
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
#endif
+6
View File
@@ -1,6 +1,9 @@
// Stub of <cuda_fp4.h> (CUDA >= 12.8 FP4 E2M1 types, used by the Blackwell MMA path of ggml-cuda/quantize.cu).
#pragma once
#include "cuda_stub.h"
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
#include "cuda_fp16.h"
#include "cuda_bf16.h"
typedef unsigned char __nv_fp4_storage_t;
@@ -12,3 +15,6 @@ struct __nv_fp4x2_e2m1 { __nv_fp4x2_storage_t __x; __nv_fp4x2_e2m1() = default;
struct __nv_fp4x4_e2m1 { __nv_fp4x4_storage_t __x; __nv_fp4x4_e2m1() = default; __nv_fp4x4_e2m1(float4); __nv_fp4x4_e2m1(float2, float2); __nv_fp4x4_e2m1(__half2, __half2); };
__half2_raw __nv_cvt_fp4x2_to_halfraw2(__nv_fp4x2_storage_t, __nv_fp4_interpretation_t);
__nv_fp4x2_storage_t __nv_cvt_float2_to_fp4x2(float2, __nv_fp4_interpretation_t, int);
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
+6
View File
@@ -1,6 +1,12 @@
// Stub of <cuda_fp8.h>.
#pragma once
#include "cuda_stub.h"
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
typedef unsigned char __nv_fp8_storage_t;
struct __nv_fp8_e4m3 { __nv_fp8_storage_t __x; __nv_fp8_e4m3() = default; __nv_fp8_e4m3(float); __nv_fp8_e4m3(double); __nv_fp8_e4m3(int); operator float() const; };
struct __nv_fp8_e5m2 { __nv_fp8_storage_t __x; __nv_fp8_e5m2() = default; __nv_fp8_e5m2(float); __nv_fp8_e5m2(double); operator float() const; };
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
+144 -13
View File
@@ -39,6 +39,21 @@
#define __CUDA_ARCH_LIST__ 1200
// ---------------------------------------------------------------------------------------------------- qualifiers
#if defined(__CUDA__)
// clang's CUDA frontend (check-cu.py --cuda): the qualifiers are real, so host/device call legality, __shared__ rules and
// the <<<>>> syntax are checked by the compiler itself. Everything below is declared __host__ __device__ (the region ends
// at the bottom of this file); the builtin variables and the libm overloads are __device__.
#define __global__ __attribute__((global))
#define __device__ __attribute__((device))
#define __host__ __attribute__((host))
#define __shared__ __attribute__((shared))
#define __constant__ __attribute__((constant))
#define __managed__ __attribute__((managed))
#define __forceinline__ __inline__ __attribute__((always_inline))
#define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__)))
#define __grid_constant__ __attribute__((grid_constant))
#define CUDA_STUB_DEVVAR __device__
#else
#define __global__
#define __device__
#define __host__
@@ -47,15 +62,19 @@
#define __shared__
#define __constant__
#define __managed__
#define __launch_bounds__(...)
#define __grid_constant__
#define CUDA_STUB_DEVVAR
#endif
#define __restrict__ __restrict
#define __align__(n) __attribute__((aligned(n)))
#define __launch_bounds__(...)
#define __builtin_align__(n) __attribute__((aligned(n)))
#define __maxnreg__(n)
#define __cluster_dims__(...)
#define __grid_constant__
#define __builtin_assume(x) ((void) 0)
#define CUDA_STUB_HOST_DEVICE
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
// ---------------------------------------------------------------------------------------------------- vector types
#define CUDA_STUB_VEC1(T, N) struct N##1 { T x; }; static inline N##1 make_##N##1(T x) { return N##1{x}; }
@@ -124,11 +143,11 @@ struct dim3 {
constexpr dim3(uint3 v) : x(v.x), y(v.y), z(v.z) {}
constexpr operator uint3() const { return uint3{x, y, z}; }
};
extern const uint3 threadIdx;
extern const uint3 blockIdx;
extern const dim3 blockDim;
extern const dim3 gridDim;
extern const int warpSize;
extern CUDA_STUB_DEVVAR const uint3 threadIdx;
extern CUDA_STUB_DEVVAR const uint3 blockIdx;
extern CUDA_STUB_DEVVAR const dim3 blockDim;
extern CUDA_STUB_DEVVAR const dim3 gridDim;
extern CUDA_STUB_DEVVAR const int warpSize;
// ---------------------------------------------------------------------------------------------------- errors / runtime API
typedef int cudaError_t;
@@ -186,6 +205,9 @@ cudaError_t cudaMemGetInfo(size_t*, size_t*);
cudaError_t cudaMallocHost(void**, size_t);
cudaError_t cudaFreeHost(void*);
cudaError_t cudaMemset(void*, int, size_t);
// driver API / cuBLAS names that ggml-cuda/common.cuh mentions in host helpers
CUresult cuGetErrorString(CUresult, const char**);
const char* cublasGetStatusString(int);
cudaError_t cudaLaunchKernel(const void*, dim3, dim3, void**, size_t, cudaStream_t);
// ---------------------------------------------------------------------------------------------------- integer / float intrinsics
@@ -351,7 +373,9 @@ static inline int __vimax_s32(int a, int b) { return max(a, b); }
static inline int __vimin_s32(int a, int b) { return min(a, b); }
// ---------------------------------------------------------------------------------------------------- synchronisation, warp, memory
#if !defined(__CUDA__)
void __syncthreads();
#endif
int __syncthreads_count(int);
int __syncthreads_and(int);
int __syncthreads_or(int);
@@ -361,7 +385,6 @@ void __threadfence_block();
void __threadfence_system();
void __nanosleep(unsigned);
long long clock64();
clock_t clock();
void __trap();
void __brkpt();
unsigned __activemask();
@@ -445,8 +468,116 @@ template <class A, class B> cuda_stub_cfg_t cuda_stub_cfg(A&&, B&&) { return {};
template <class A, class B, class C> cuda_stub_cfg_t cuda_stub_cfg(A&&, B&&, C&&) { return {}; }
template <class A, class B, class C, class D> cuda_stub_cfg_t cuda_stub_cfg(A&&, B&&, C&&, D&&) { return {}; }
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif
#if defined(__CUDA__)
extern "C" unsigned __cudaPushCallConfiguration(dim3, dim3, size_t = 0, void* = nullptr);
extern "C" int cudaConfigureCall(dim3, dim3, size_t = 0, void* = nullptr); // older toolkit spelling, clang looks for either
#endif
// ---- device libm: __host__ __device__ statics so device code resolves expf(x) etc. (clang's own wrappers do the same)
#if defined(__CUDA__)
static __device__ inline float sinf(float x) { return __builtin_sinf(x); }
static __device__ inline float cosf(float x) { return __builtin_cosf(x); }
static __device__ inline float tanf(float x) { return __builtin_tanf(x); }
static __device__ inline float asinf(float x) { return __builtin_asinf(x); }
static __device__ inline float acosf(float x) { return __builtin_acosf(x); }
static __device__ inline float atanf(float x) { return __builtin_atanf(x); }
static __device__ inline float sinhf(float x) { return __builtin_sinhf(x); }
static __device__ inline float coshf(float x) { return __builtin_coshf(x); }
static __device__ inline float tanhf(float x) { return __builtin_tanhf(x); }
static __device__ inline float asinhf(float x) { return __builtin_asinhf(x); }
static __device__ inline float acoshf(float x) { return __builtin_acoshf(x); }
static __device__ inline float atanhf(float x) { return __builtin_atanhf(x); }
static __device__ inline float expf(float x) { return __builtin_expf(x); }
static __device__ inline float exp2f(float x) { return __builtin_exp2f(x); }
static __device__ inline float expm1f(float x) { return __builtin_expm1f(x); }
static __device__ inline float logf(float x) { return __builtin_logf(x); }
static __device__ inline float log2f(float x) { return __builtin_log2f(x); }
static __device__ inline float log10f(float x) { return __builtin_log10f(x); }
static __device__ inline float log1pf(float x) { return __builtin_log1pf(x); }
static __device__ inline float sqrtf(float x) { return __builtin_sqrtf(x); }
static __device__ inline float cbrtf(float x) { return __builtin_cbrtf(x); }
static __device__ inline float fabsf(float x) { return __builtin_fabsf(x); }
static __device__ inline float floorf(float x) { return __builtin_floorf(x); }
static __device__ inline float ceilf(float x) { return __builtin_ceilf(x); }
static __device__ inline float roundf(float x) { return __builtin_roundf(x); }
static __device__ inline float rintf(float x) { return __builtin_rintf(x); }
static __device__ inline float truncf(float x) { return __builtin_truncf(x); }
static __device__ inline float nearbyintf(float x) { return __builtin_nearbyintf(x); }
static __device__ inline float erff(float x) { return __builtin_erff(x); }
static __device__ inline float erfcf(float x) { return __builtin_erfcf(x); }
static __device__ inline float lgammaf(float x) { return __builtin_lgammaf(x); }
static __device__ inline float tgammaf(float x) { return __builtin_tgammaf(x); }
static __device__ inline float logbf(float x) { return __builtin_logbf(x); }
static __device__ inline float atan2f(float x, float y) { return __builtin_atan2f(x, y); }
static __device__ inline float powf(float x, float y) { return __builtin_powf(x, y); }
static __device__ inline float fmaxf(float x, float y) { return __builtin_fmaxf(x, y); }
static __device__ inline float fminf(float x, float y) { return __builtin_fminf(x, y); }
static __device__ inline float fmodf(float x, float y) { return __builtin_fmodf(x, y); }
static __device__ inline float copysignf(float x, float y) { return __builtin_copysignf(x, y); }
static __device__ inline float hypotf(float x, float y) { return __builtin_hypotf(x, y); }
static __device__ inline float remainderf(float x, float y) { return __builtin_remainderf(x, y); }
static __device__ inline float nextafterf(float x, float y) { return __builtin_nextafterf(x, y); }
static __device__ inline float fdimf(float x, float y) { return __builtin_fdimf(x, y); }
static __device__ inline double sin(double x) { return __builtin_sin(x); }
static __device__ inline double cos(double x) { return __builtin_cos(x); }
static __device__ inline double tan(double x) { return __builtin_tan(x); }
static __device__ inline double asin(double x) { return __builtin_asin(x); }
static __device__ inline double acos(double x) { return __builtin_acos(x); }
static __device__ inline double atan(double x) { return __builtin_atan(x); }
static __device__ inline double sinh(double x) { return __builtin_sinh(x); }
static __device__ inline double cosh(double x) { return __builtin_cosh(x); }
static __device__ inline double tanh(double x) { return __builtin_tanh(x); }
static __device__ inline double exp(double x) { return __builtin_exp(x); }
static __device__ inline double exp2(double x) { return __builtin_exp2(x); }
static __device__ inline double expm1(double x) { return __builtin_expm1(x); }
static __device__ inline double log(double x) { return __builtin_log(x); }
static __device__ inline double log2(double x) { return __builtin_log2(x); }
static __device__ inline double log10(double x) { return __builtin_log10(x); }
static __device__ inline double log1p(double x) { return __builtin_log1p(x); }
static __device__ inline double sqrt(double x) { return __builtin_sqrt(x); }
static __device__ inline double cbrt(double x) { return __builtin_cbrt(x); }
static __device__ inline double fabs(double x) { return __builtin_fabs(x); }
static __device__ inline double floor(double x) { return __builtin_floor(x); }
static __device__ inline double ceil(double x) { return __builtin_ceil(x); }
static __device__ inline double round(double x) { return __builtin_round(x); }
static __device__ inline double rint(double x) { return __builtin_rint(x); }
static __device__ inline double trunc(double x) { return __builtin_trunc(x); }
static __device__ inline double nearbyint(double x) { return __builtin_nearbyint(x); }
static __device__ inline double erf(double x) { return __builtin_erf(x); }
static __device__ inline double erfc(double x) { return __builtin_erfc(x); }
static __device__ inline double lgamma(double x) { return __builtin_lgamma(x); }
static __device__ inline double tgamma(double x) { return __builtin_tgamma(x); }
static __device__ inline double atan2(double x, double y) { return __builtin_atan2(x, y); }
static __device__ inline double pow(double x, double y) { return __builtin_pow(x, y); }
static __device__ inline double fmax(double x, double y) { return __builtin_fmax(x, y); }
static __device__ inline double fmin(double x, double y) { return __builtin_fmin(x, y); }
static __device__ inline double fmod(double x, double y) { return __builtin_fmod(x, y); }
static __device__ inline double copysign(double x, double y) { return __builtin_copysign(x, y); }
static __device__ inline double hypot(double x, double y) { return __builtin_hypot(x, y); }
static __device__ inline double remainder(double x, double y) { return __builtin_remainder(x, y); }
static __device__ inline float fmaf(float x, float y, float z) { return __builtin_fmaf(x, y, z); }
static __device__ inline double fma(double x, double y, double z) { return __builtin_fma(x, y, z); }
static __device__ inline float ldexpf(float x, int e) { return __builtin_ldexpf(x, e); }
static __device__ inline float frexpf(float x, int* e) { return __builtin_frexpf(x, e); }
static __device__ inline float scalbnf(float x, int e) { return __builtin_scalbnf(x, e); }
static __device__ inline long lroundf(float x) { return __builtin_lroundf(x); }
static __device__ inline long lrintf(float x) { return __builtin_lrintf(x); }
static __device__ inline int abs(int x) { return x < 0 ? -x : x; }
static __device__ inline long long llabs(long long x) { return x < 0 ? -x : x; }
static __device__ inline bool isnan(float x) { return __builtin_isnan(x); }
static __device__ inline bool isinf(float x) { return __builtin_isinf(x); }
static __device__ inline bool isfinite(float x) { return __builtin_isfinite(x); }
static __device__ inline bool isnan(double x) { return __builtin_isnan(x); }
static __device__ inline bool isinf(double x) { return __builtin_isinf(x); }
static __device__ inline bool isfinite(double x) { return __builtin_isfinite(x); }
static __device__ inline void* memcpy(void* d, const void* s, size_t n) { return __builtin_memcpy(d, s, n); }
static __device__ inline void* memset(void* d, int c, size_t n) { return __builtin_memset(d, c, n); }
static __device__ inline void* memmove(void* d, const void* s, size_t n) { return __builtin_memmove(d, s, n); }
static __device__ inline int memcmp(const void* a, const void* b, size_t n) { return __builtin_memcmp(a, b, n); }
extern "C" __device__ int vprintf(const char*, const char*);
template <class... A> __device__ inline int cuda_stub_printf(const char*, A...) { return 0; } // check-cu.py rewrites printf( call sites to it
static __device__ inline bool signbit(float x) { return __builtin_signbit(x); }
#endif
#endif
// driver API / cuBLAS names that ggml-cuda/common.cuh mentions in host helpers
CUresult cuGetErrorString(CUresult, const char**);
const char* cublasGetStatusString(int);
+6
View File
@@ -1,6 +1,9 @@
// Stub of <mma.h> (nvcuda::wmma): fragment types only, enough for declarations to parse.
#pragma once
#include "cuda_stub.h"
#if defined(__CUDA__)
#pragma clang force_cuda_host_device begin
#endif
namespace nvcuda { namespace wmma {
struct row_major {}; struct col_major {};
struct matrix_a {}; struct matrix_b {}; struct accumulator {};
@@ -12,3 +15,6 @@ template <class F, class T> void load_matrix_sync(F&, const T*, unsigned, layout
template <class T, class F> void store_matrix_sync(T*, const F&, unsigned, layout_t);
template <class D, class A, class B, class C> void mma_sync(D&, const A&, const B&, const C&);
} }
#if defined(__CUDA__)
#pragma clang force_cuda_host_device end
#endif