Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
galeselee committed Jan 1, 2023
1 parent c168a6e commit 5816c17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
28 changes: 13 additions & 15 deletions taichi/jit/jit_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ class JITModule {
}

template <typename... Args, typename T>
static int get_args_bytes(T t, Args ...args) {
return get_args_bytes(args...) + sizeof(T);
static int get_args_bytes(T t, Args... args) {
return get_args_bytes(args...) + sizeof(T);
}

static void init_args_pointers(char *packed_args) {
return ;
return;
}

template <typename... Args, typename T>
static void init_args_pointers(char *packed_args, T t, Args ...args) {
std::memcpy(packed_args, &t, sizeof(t));
init_args_pointers(packed_args + sizeof(t), args...);
return ;
static void init_args_pointers(char *packed_args, T t, Args... args) {
std::memcpy(packed_args, &t, sizeof(t));
init_args_pointers(packed_args + sizeof(t), args...);
return;
}

// Note: **call** is for serial functions
Expand All @@ -78,20 +78,18 @@ class JITModule {
auto arg_pointers = JITModule::get_arg_pointers(args...);
call(name, arg_pointers);
#else
TI_NOT_IMPLEMENTED
TI_NOT_IMPLEMENTED
#endif
}
else if (module_arch() == Arch::amdgpu) {
#if defined(TI_WITH_CUDA)
} else if (module_arch() == Arch::amdgpu) {
#if defined(TI_WITH_AMDGPU)
auto arg_bytes = JITModule::get_args_bytes(args...);
char packed_args[arg_bytes];
JITModule::init_args_pointers(packed_args, args...);
call(name, { (void*)packed_args , (void*)&arg_bytes});
call(name, {(void *)packed_args, (void *)&arg_bytes});
#else
TI_NOT_IMPLEMENTED
TI_NOT_IMPLEMENTED
#endif
}
else {
} else {
TI_ERROR("unknown module arch")
}
}
Expand Down
5 changes: 2 additions & 3 deletions taichi/rhi/amdgpu/amdgpu_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ void AMDGPUContext::launch(void *func,
unsigned block_dim,
std::size_t dynamic_shared_mem_bytes) {
if (grid_dim > 0) {

std::lock_guard<std::mutex> _(lock_);
void *config[] = {(void *)0x01, arg_pointers[0],
(void *)0x02, arg_pointers[1], (void *)0x03};
void *config[] = {(void *)0x01, arg_pointers[0], (void *)0x02,
arg_pointers[1], (void *)0x03};
driver_.launch_kernel(func, grid_dim, 1, 1, block_dim, 1, 1,
dynamic_shared_mem_bytes, nullptr, nullptr,
reinterpret_cast<void **>(&config));
Expand Down

0 comments on commit 5816c17

Please sign in to comment.