-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tensor cufile wip #264
base: unstable
Are you sure you want to change the base?
tensor cufile wip #264
Conversation
lib/nnc/ccv_nnc_tensor.c
Outdated
ccv_nnc_cuda_file_entry file_entry = ccv_nnc_get_file_entry(filename); | ||
// Open the file using cuFile | ||
tensor->data.u8 = (uint8_t*)cuDirectFileReadAsync(CCV_TENSOR_GET_DEVICE_ID(params.type), size, filename, offset, cuSharedFileIOStream(), file_entry.file_handle, file_entry.file_descr); | ||
cuSharedStreamSync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync here 10/10 pass test
ccv_nnc_tensor_t* a_result = ccv_nnc_tensor_new(0, GPU_TENSOR_NHWC(000, 32F, 5), 0); | ||
ccv_nnc_cmd_exec(CMD_ADD_FORWARD(0.5, 0.2), ccv_nnc_no_hint, 0, TENSOR_LIST(tensor_a, one_gpu), TENSOR_LIST(a_result), 0); | ||
float a[] = {1 * 0.5 + 0.2, 2 * 0.5 + 0.2, 3 * 0.5 + 0.2, 4 * 0.5 + 0.2, 5 * 0.5 + 0.2}; | ||
ccv_nnc_tensor_t* tensor_b = ccv_nnc_tensor_new_from_file(GPU_TENSOR_NHWC(000, 32F, 4), "tensor.bin", (4096 * 4 * 4), 0); | ||
cuSharedStreamSync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync here 4/10 pass test...
for (int i = 0; i < MAX_FILES; i++) { | ||
if (!file_map[i].is_used) { | ||
memset(&file_map[i], 0, sizeof(ccv_nnc_cuda_file_entry)); | ||
strncpy(file_map[i].filename, filename, sizeof(file_map[i].filename) - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strlen(filename) + 1
No description provided.