Skip to content

Commit

Permalink
adding setFlag and clearFlag for storages
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Dec 19, 2015
1 parent fe768d7 commit 6335106
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions THCStorage.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ THCudaStorage* THCudaStorage_newWithData(THCState *state, float *data, long size
return storage;
}

void THCudaStorage_setFlag(THCState *state, THCudaStorage *storage, const char flag)
{
storage->flag |= flag;
}

void THCudaStorage_clearFlag(THCState *state, THCudaStorage *storage, const char flag)
{
storage->flag &= ~flag;
}

void THCudaStorage_retain(THCState *state, THCudaStorage *self)
{
if(self && (self->flag & TH_STORAGE_REFCOUNTED))
Expand Down

0 comments on commit 6335106

Please sign in to comment.