-
Notifications
You must be signed in to change notification settings - Fork 8
Add riscv64 and Imagination Technologies GPUs support #232
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,15 @@ namespace spla { | |
auto* cl_csr = s.template get<CLCsr<T>>(); | ||
auto* cpu_csr = s.template get<CpuCsr<T>>(); | ||
cpu_csr_resize(s.get_n_rows(), cl_csr->values, *cpu_csr); | ||
cl_csr_read(s.get_n_rows(), cl_csr->values, cpu_csr->Ap.data(), cpu_csr->Aj.data(), cpu_csr->Ax.data(), *cl_csr, cl_acc->get_queue_default()); | ||
if (!cl_acc->is_img()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, comments with explanation and references to related documents are necessary here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
cl_csr_read(s.get_n_rows(), cl_csr->values, cpu_csr->Ap.data(), cpu_csr->Aj.data(), cpu_csr->Ax.data(), *cl_csr, cl_acc->get_queue_default()); | ||
} else { | ||
// On Imagination Technologies devices copying data to staging buffer created with CL_MEM_READ_ONLY flag does not affect this buffer. | ||
// According to the [documentation](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clEnqueueCopyBuffer), | ||
// this flag should not affect copying, but you have to create a buffer without this flag to keep it correct. | ||
cl_csr_read(s.get_n_rows(), cl_csr->values, cpu_csr->Ap.data(), cpu_csr->Aj.data(), cpu_csr->Ax.data(), *cl_csr, cl_acc->get_queue_default(), | ||
CL_MEM_HOST_READ_ONLY | CL_MEM_ALLOC_HOST_PTR); | ||
} | ||
}); | ||
#endif | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,15 @@ namespace spla { | |
auto* cl_acc = get_acc_cl(); | ||
auto* cl_dense = s.template get<CLDenseVec<T>>(); | ||
auto* cpu_dense = s.template get<CpuDenseVec<T>>(); | ||
cl_dense_vec_read(s.get_n_rows(), cpu_dense->Ax.data(), *cl_dense, cl_acc->get_queue_default()); | ||
if (!cl_acc->is_img()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, comments with explanation and references to related documents are necessary here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
cl_dense_vec_read(s.get_n_rows(), cpu_dense->Ax.data(), *cl_dense, cl_acc->get_queue_default()); | ||
} else { | ||
// On Imagination Technologies devices copying data to staging buffer created with CL_MEM_READ_ONLY flag does not affect this buffer. | ||
// According to the [documentation](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clEnqueueCopyBuffer), | ||
// this flag should not affect copying, but you have to create a buffer without this flag to keep it correct. | ||
cl_dense_vec_read(s.get_n_rows(), cpu_dense->Ax.data(), *cl_dense, cl_acc->get_queue_default(), | ||
CL_MEM_HOST_READ_ONLY | CL_MEM_ALLOC_HOST_PTR); | ||
} | ||
}); | ||
manager.register_converter(FormatVector::CpuCoo, FormatVector::AccCoo, [](Storage& s) { | ||
auto* cpu_coo = s.template get<CpuCooVec<T>>(); | ||
|
@@ -138,7 +146,15 @@ namespace spla { | |
auto* cl_coo = s.template get<CLCooVec<T>>(); | ||
auto* cpu_coo = s.template get<CpuCooVec<T>>(); | ||
cpu_coo_vec_resize(cl_coo->values, *cpu_coo); | ||
cl_coo_vec_read(cl_coo->values, cpu_coo->Ai.data(), cpu_coo->Ax.data(), *cl_coo, cl_acc->get_queue_default()); | ||
if (!cl_acc->is_img()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, comments with explanation and references to related documents are necessary here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
cl_coo_vec_read(cl_coo->values, cpu_coo->Ai.data(), cpu_coo->Ax.data(), *cl_coo, cl_acc->get_queue_default()); | ||
} else { | ||
// On Imagination Technologies devices copying data to staging buffer created with CL_MEM_READ_ONLY flag does not affect this buffer. | ||
// According to the [documentation](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clEnqueueCopyBuffer), | ||
// this flag should not affect copying, but you have to create a buffer without this flag to keep it correct. | ||
cl_coo_vec_read(cl_coo->values, cpu_coo->Ai.data(), cpu_coo->Ax.data(), *cl_coo, cl_acc->get_queue_default(), | ||
CL_MEM_HOST_READ_ONLY | CL_MEM_ALLOC_HOST_PTR); | ||
} | ||
}); | ||
manager.register_converter(FormatVector::AccCoo, FormatVector::AccDense, [](Storage& s) { | ||
auto* cl_acc = get_acc_cl(); | ||
|
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.
Why you decided to set default wgs = 32, and not 64? It seems that 64 suits in most cases well
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.
This is a recommendation from the official Imagination Technologies blog