Created
February 7, 2014 03:06
-
-
Save allanmac/8856847 to your computer and use it in GitHub Desktop.
Why I2I?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- compile-command: "nvcc -m 32 -arch sm_35 -Xptxas=-v,-abi=no -cubin short4.cu"; -*- | |
#include <stdint.h> | |
typedef uint32_t u32; | |
typedef uint64_t u64; | |
typedef union | |
{ | |
short4 s16v4; | |
uint2 b32v2; | |
u64 b64; | |
} x64; | |
typedef union | |
{ | |
short2 s16v2; | |
u32 b32; | |
} x32; | |
// | |
// | |
// | |
extern "C" | |
__global__ | |
void t1(const int16_t* const in, int16_t* const out) | |
{ | |
__shared__ short4 mydata; | |
mydata = *(short4*)in; | |
*(short4* const)out = mydata; | |
} | |
extern "C" | |
__global__ | |
void t2(const int16_t* const in, int16_t* const out) | |
{ | |
*(short4* const)out = *(short4*)in; | |
} | |
extern "C" | |
__global__ | |
void t3(const short4* const in, short4* const out) | |
{ | |
*out = *in; | |
} | |
extern "C" | |
__global__ | |
void t4(const x64* const in, x64* const out) | |
{ | |
*out = *in; | |
} | |
extern "C" | |
__global__ | |
void t5(const x64* const in, x64* const out) | |
{ | |
(*out).b32v2 = (*in).b32v2; | |
} | |
extern "C" | |
__global__ | |
void t6(const x64* const in, x64* const out) | |
{ | |
(*out).b64 = (*in).b64; | |
} | |
extern "C" | |
__global__ | |
void t7(const x64* const in, x64* const out) | |
{ | |
(*out).s16v4 = (*in).s16v4; | |
} | |
extern "C" | |
__global__ | |
void t8(const x32* const in, x32* const out) | |
{ | |
*out = *in; | |
} | |
extern "C" | |
__global__ | |
void t9(const x32* const in, x32* const out) | |
{ | |
(*out).b32 = (*in).b32; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cuobjdump.exe -sass short4.cubin