Skip to content

Commit

Permalink
Removing type from THStorage.
Browse files Browse the repository at this point in the history
  • Loading branch information
zakattacktwitter committed May 26, 2015
1 parent 624de00 commit f938d15
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
9 changes: 0 additions & 9 deletions lib/TH/THGeneral.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,4 @@ do { \
#define pclose _pclose
#endif

#define TH_Byte 1
#define TH_Char 2
#define TH_Short 3
#define TH_Int 4
#define TH_Long 5
#define TH_Float 6
#define TH_Double 7
#define TH_Cuda 8

#endif
2 changes: 0 additions & 2 deletions lib/TH/THStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#define TH_STORAGE_GET(storage, idx) ((storage)->data[(idx)])
#define TH_STORAGE_SET(storage, idx, value) ((storage)->data[(idx)] = (value))

#define TH_Type() TH_CONCAT_2(TH_,Real)

#include "generic/THStorage.h"
#include "THGenerateAllTypes.h"

Expand Down
2 changes: 0 additions & 2 deletions lib/TH/generic/THStorage.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ THStorage* THStorage_(newWithAllocator)(long size,
storage->flag = TH_STORAGE_REFCOUNTED | TH_STORAGE_RESIZABLE | TH_STORAGE_FREEMEM;
storage->allocator = allocator;
storage->allocatorContext = allocatorContext;
storage->type = TH_Type();
return storage;
}

Expand Down Expand Up @@ -144,7 +143,6 @@ THStorage* THStorage_(newWithDataAndAllocator)(real* data, long size,
storage->flag = TH_STORAGE_REFCOUNTED | TH_STORAGE_RESIZABLE | TH_STORAGE_FREEMEM;
storage->allocator = allocator;
storage->allocatorContext = allocatorContext;
storage->type = TH_Type();
return storage;
}

Expand Down
5 changes: 2 additions & 3 deletions lib/TH/generic/THStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
Pb: THMapStorage is kind of a class
THLab_()... comment je m'en sors?
en template, faudrait que je les instancie toutes!!! oh boy!
Et comment je sais que c'est pour Cuda? Le type float est le meme dans les <>
au bout du compte, ca serait sur des pointeurs float/double... etc... = facile.
primitives??
*/
Expand All @@ -29,7 +29,6 @@ typedef struct THStorage
char flag;
THAllocator *allocator;
void *allocatorContext;
int type;
struct THStorage *view;
} THStorage;

Expand Down

0 comments on commit f938d15

Please sign in to comment.