Example #1
0
 def call_const(self, env, dtype, size):
     name = env.get_fresh_variable_name(prefix='_smem')
     child_type = _cuda_types.Scalar(dtype)
     while env[name] is not None:
         name = env.get_fresh_variable_name(prefix='_smem')  # retry
     env[name] = Data(name, _cuda_types.SharedMem(child_type, size))
     return Data(name, _cuda_types.Ptr(child_type))
Example #2
0
 def call_const(self, env, dtype, size, alignment=None):
     name = env.get_fresh_variable_name(prefix='_smem')
     child_type = _cuda_types.Scalar(dtype)
     var = Data(name, _cuda_types.SharedMem(child_type, size, alignment))
     env.decls[name] = var
     env.locals[name] = var
     return Data(name, _cuda_types.Ptr(child_type))