Skip to content

Commit

Permalink
update kernel inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
xhuohai committed Sep 5, 2023
1 parent 7d121bd commit 4c9aaad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/cpu/src/runtime/cmodel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function(add_test name test_path)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(-O1)
endif()
add_link_options(-no-pie -nostartfiles -fPIC -fno-stack-protector -static -Wl,-e,_Z6_startP19hardware_context_mtP15runtime_util_mtPhS3_S3_)
add_link_options(-no-pie -nostartfiles -fPIC -fno-stack-protector -static -Wl,-e,_Z6_startP19hardware_context_mtP15runtime_util_mtPPh)
add_executable(${name} "${test_path}/main.cpp")
target_link_libraries(${name} cpu_cmodel)
endfunction(add_test)
Expand Down
9 changes: 4 additions & 5 deletions modules/cpu/src/runtime/cmodel/tests/demo4/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,20 @@ DEFINE_BFUNC(6)
DEFINE_BFUNC(7)

void _start(hardware_context_mt *hw_impl, runtime_util_mt *rt_util_mt,
uint8_t *position_ids, uint8_t *gather_data, uint8_t *output) {
uint8_t **inputs) {
global_hardware_init(hw_impl);
runtime_util = *rt_util_mt;
runtime_util.printf("%p\t%p\n", gather_data, output);

auto Position_ids_ = tensor<int64_t, loc_t::device>(
gsl::make_span((int64_t *)position_ids, 384), {1, 384});
gsl::make_span((int64_t *)inputs[0], 384), {1, 384});
runtime_util.printf("1\n");

auto GatherData_ = tensor<float, loc_t::device>(
gsl::make_span((float *)gather_data, 384*8192), {384, 8192});
gsl::make_span((float *)inputs[1], 384 * 8192), {384, 8192});

runtime_util.printf("2\n");
auto Output_ = tensor<float, loc_t::device>(
gsl::make_span((float *)output, 384*8192), {1, 384, 8192});
gsl::make_span((float *)inputs[2], 384 * 8192), {1, 384, 8192});

runtime_util.printf("3\n");
Position_ids = &Position_ids_;
Expand Down

0 comments on commit 4c9aaad

Please sign in to comment.