mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-07-01 08:51:56 +08:00
fix bugs on failure of mm example
Signed-off-by: Jinjie Liu <jjliu@baai.ac.cn>
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#include <cassert>
|
||||
#include <assert.h>
|
||||
#include <cuda.h>
|
||||
#include <tvm/ffi/tvm_ffi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
TVM_FFI_DLL_EXPORT void __tvm_ffi_launch(void *handle, const TVMFFIAny *args, int32_t num_args, TVMFFIAny *result) {
|
||||
TVM_FFI_DLL_EXPORT void
|
||||
__tvm_ffi_launch(void *handle, const TVMFFIAny *args, int32_t num_args,
|
||||
TVMFFIAny *result) {
|
||||
int32_t gridX = args[0].v_int64;
|
||||
int32_t gridY = args[1].v_int64;
|
||||
int32_t gridZ = args[2].v_int64;
|
||||
@@ -22,8 +24,7 @@ TVM_FFI_DLL_EXPORT void __tvm_ffi_launch(void *handle, const TVMFFIAny *args, in
|
||||
config.gridDimX = gridX * numCtas;
|
||||
config.gridDimY = gridY;
|
||||
config.gridDimZ = gridZ;
|
||||
static constexpr int32_t kThreadsPerWarp = 32;
|
||||
config.blockDimX = kThreadsPerWarp * numWarps;
|
||||
config.blockDimX = 32 * numWarps;
|
||||
config.blockDimY = 1;
|
||||
config.blockDimZ = 1;
|
||||
config.sharedMemBytes = sharedMemory;
|
||||
@@ -56,8 +57,7 @@ TVM_FFI_DLL_EXPORT void __tvm_ffi_launch(void *handle, const TVMFFIAny *args, in
|
||||
assert(false, "unsupported type yet {{ type }}");
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
void *foo = NULL, *bar = NULL;
|
||||
void *params[] = { {% for type in signature %} &arg{{ loop.index0 }}, {% endfor %}&foo, &bar };
|
||||
void *params[] = { {% for type in signature %} &arg{{ loop.index0 }}, {% endfor %}&globalScratch, &profileScratch };
|
||||
cuLaunchKernelEx(&config, function, params, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user