diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-10-17 17:42:47 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2016-10-17 17:42:47 +0300 |
commit | 9d35ccb9c3690f6b98acdaaec73b142da47f6665 (patch) | |
tree | 717a702874c4ed6baa878508fb08bf22d1e1aa27 | |
parent | 2b598fe5c226995b04c8270e1b723a7b20c027d4 (diff) |
guards for half
-rw-r--r-- | init.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -901,13 +901,21 @@ static int cutorch_shutdown(lua_State *L) static int cutorch_hasHalfInstructions(lua_State *L) { THCState *state = cutorch_getstate(L); +#ifdef CUDA_HALF_TENSOR lua_pushboolean(L, THC_nativeHalfInstructions(state)); +#else + lua_pushboolean(L, false); +#endif return 1; } static int cutorch_hasFastHalfInstructions(lua_State *L) { THCState *state = cutorch_getstate(L); +#ifdef CUDA_HALF_TENSOR lua_pushboolean(L, THC_fastHalfInstructions(state)); +#else + lua_pushboolean(L, false); +#endif return 1; } |