Videre
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
// Not all CUDA includes are safe to include in device code compiled by NVRTC,
|
||||
// because it does not have paths to all system include directories. Headers
|
||||
// such as cuda_device_runtime_api.h are safe to use in NVRTC without adding
|
||||
// additional includes.
|
||||
#include <cuda_device_runtime_api.h>
|
||||
@@ -0,0 +1,7 @@
|
||||
extern "C" __device__
|
||||
int bar(int* out, int a) {
|
||||
// Explicitly placed to generate an error
|
||||
SYNTAX ERROR
|
||||
*out = a * 2;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Compile with:
|
||||
//
|
||||
// nvcc -gencode arch=compute_50,code=compute_50 -rdc true -ptx jitlink.cu
|
||||
//
|
||||
// using the oldest supported toolkit version (10.2 at the time of writing).
|
||||
|
||||
extern "C" __device__
|
||||
int bar(int *out, int a)
|
||||
{
|
||||
*out = a * 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// The out argument is necessary due to Numba's CUDA calling convention, which
|
||||
// always reserves the first parameter for a pointer to a returned value, even
|
||||
// if there is no return value.
|
||||
extern "C" __device__
|
||||
int array_mutator(void *out, int *a)
|
||||
{
|
||||
a[0] = a[1];
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// Generated by NVIDIA NVVM Compiler
|
||||
//
|
||||
// Compiler Build ID: CL-27506705
|
||||
// Cuda compilation tools, release 10.2, V10.2.89
|
||||
// Based on LLVM 3.4svn
|
||||
//
|
||||
|
||||
.version 6.5
|
||||
.target sm_50
|
||||
.address_size 64
|
||||
|
||||
// .globl bar
|
||||
|
||||
.visible .func (.param .b32 func_retval0) bar(
|
||||
.param .b64 bar_param_0,
|
||||
.param .b32 bar_param_1
|
||||
)
|
||||
{
|
||||
.reg .b32 %r<4>;
|
||||
.reg .b64 %rd<2>;
|
||||
|
||||
|
||||
ld.param.u64 %rd1, [bar_param_0];
|
||||
ld.param.u32 %r1, [bar_param_1];
|
||||
shl.b32 %r2, %r1, 1;
|
||||
st.u32 [%rd1], %r2;
|
||||
mov.u32 %r3, 0;
|
||||
st.param.b32 [func_retval0+0], %r3;
|
||||
ret;
|
||||
}
|
||||
|
||||
// .globl array_mutator
|
||||
.visible .func (.param .b32 func_retval0) array_mutator(
|
||||
.param .b64 array_mutator_param_0,
|
||||
.param .b64 array_mutator_param_1
|
||||
)
|
||||
{
|
||||
.reg .b32 %r<3>;
|
||||
.reg .b64 %rd<2>;
|
||||
|
||||
|
||||
ld.param.u64 %rd1, [array_mutator_param_1];
|
||||
ld.u32 %r1, [%rd1+4];
|
||||
st.u32 [%rd1], %r1;
|
||||
mov.u32 %r2, 0;
|
||||
st.param.b32 [func_retval0+0], %r2;
|
||||
ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
extern "C" __device__
|
||||
int bar(int* out, int a) {
|
||||
// Explicitly placed to generate a warning for testing the NVRTC program log
|
||||
int unused;
|
||||
*out = a * 2;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user