From 172c82e6566fd8aa4a4bf717bbf38451096830f7 Mon Sep 17 00:00:00 2001 From: Gregory Chanan Date: Wed, 22 Feb 2017 11:57:54 -0800 Subject: [PATCH] Remove accreal typedef because it is defined multiple times with nn. --- THCUNN.lua | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/THCUNN.lua b/THCUNN.lua index d5bf1c2a..d5a8a6fa 100644 --- a/THCUNN.lua +++ b/THCUNN.lua @@ -45,23 +45,16 @@ local replacements_generic = ['THCTensor'] = 'THCudaTensor', ['THCIndexTensor'] = 'THCudaLongTensor', ['TYPE'] = 'Cuda', - ['real'] = 'float', + ['accreal'] = 'float', }, { ['THCTensor'] = 'THCudaDoubleTensor', ['THCIndexTensor'] = 'THCudaLongTensor', ['TYPE'] = 'CudaDouble', - ['real'] = 'double', + ['accreal'] = 'double', } } --- gsub(s, 'real', 'float') changes accreal to accfloat. --- typedef accfloat ahead of time. -ffi.cdef("typedef float accfloat;") --- gsub(s, 'real', 'double') changes accreal to accfloat. --- typedef accdouble ahead of time -ffi.cdef("typedef double accdouble;") - if cutorch.hasHalf then ffi.cdef("half THC_float2half(float a);") ffi.cdef("float THC_half2float(half a);") @@ -70,12 +63,9 @@ if cutorch.hasHalf then ['THCTensor'] = 'THCudaHalfTensor', ['THCIndexTensor'] = 'THCudaLongTensor', ['TYPE'] = 'CudaHalf', - ['real'] = 'half', + ['accreal'] = 'float', } table.insert(replacements_generic, half_replacement) - -- gsub(s, 'real', 'double') changes accreal to accfloat. - -- typedef acchalf ahead of time - ffi.cdef("typedef float acchalf;") end for i=1,#replacements_generic do