Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cutorch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-10-17 17:42:47 +0300
committerSoumith Chintala <soumith@gmail.com>2016-10-17 17:42:47 +0300
commit9d35ccb9c3690f6b98acdaaec73b142da47f6665 (patch)
tree717a702874c4ed6baa878508fb08bf22d1e1aa27
parent2b598fe5c226995b04c8270e1b723a7b20c027d4 (diff)
guards for half
-rw-r--r--init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/init.c b/init.c
index b5c0f05..184027a 100644
--- a/init.c
+++ b/init.c
@@ -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;
}