Skip to content

Doc improvements #231

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

Merged
merged 9 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions dpctl-capi/source/dpctl_sycl_queue_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ QMgrHelper::getQueue (DPCTLSyclBackendType BETy,
QRef = new queue(gpuQs[DNum]);
break;
}
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
DPCTLSyclDeviceType::DPCTL_GPU:
{
auto l0GpuQs = get_level0_gpu_queues();
if (DNum >= l0GpuQs.size()) {
Expand Down Expand Up @@ -316,7 +317,8 @@ QMgrHelper::setAsDefaultQueue (DPCTLSyclBackendType BETy,
activeQ[0] = oclgpu_q[DNum];
break;
}
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
DPCTLSyclDeviceType::DPCTL_GPU:
{
auto l0gpu_q = get_level0_gpu_queues();
if (DNum >= l0gpu_q.size()) {
Expand All @@ -342,8 +344,8 @@ QMgrHelper::setAsDefaultQueue (DPCTLSyclBackendType BETy,
/*!
* Allocates a new sycl::queue by copying from the cached {cpu|gpu}_queues
* vector. The pointer returned is now owned by the caller and must be properly
* cleaned up. The helper function DPCTLDeleteSyclQueue() can be used is for that
* purpose.
* cleaned up. The helper function DPCTLDeleteSyclQueue() can be used is for
* that purpose.
*/
__dpctl_give DPCTLSyclQueueRef
QMgrHelper::pushSyclQueue (DPCTLSyclBackendType BETy,
Expand Down Expand Up @@ -383,7 +385,8 @@ QMgrHelper::pushSyclQueue (DPCTLSyclBackendType BETy,
QRef = new queue(activeQ[get_active_queues().size()-1]);
break;
}
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
DPCTLSyclDeviceType::DPCTL_GPU:
{
if (DNum >= get_level0_gpu_queues().size()) {
// \todo handle error
Expand Down Expand Up @@ -447,7 +450,7 @@ size_t DPCTLQueueMgr_GetNumActivatedQueues ()
* type combination.
*/
size_t DPCTLQueueMgr_GetNumQueues (DPCTLSyclBackendType BETy,
DPCTLSyclDeviceType DeviceTy)
DPCTLSyclDeviceType DeviceTy)
{
switch (BETy|DeviceTy)
{
Expand All @@ -459,7 +462,8 @@ size_t DPCTLQueueMgr_GetNumQueues (DPCTLSyclBackendType BETy,
{
return QMgrHelper::get_opencl_gpu_queues().size();
}
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
DPCTLSyclDeviceType::DPCTL_GPU:
{
return QMgrHelper::get_level0_gpu_queues().size();
}
Expand All @@ -485,8 +489,8 @@ DPCTLSyclQueueRef DPCTLQueueMgr_GetCurrentQueue ()
* and device number. A runtime_error gets thrown if no such device exists.
*/
DPCTLSyclQueueRef DPCTLQueueMgr_GetQueue (DPCTLSyclBackendType BETy,
DPCTLSyclDeviceType DeviceTy,
size_t DNum)
DPCTLSyclDeviceType DeviceTy,
size_t DNum)
{
return QMgrHelper::getQueue(BETy, DeviceTy, DNum);
}
Expand All @@ -506,8 +510,8 @@ bool DPCTLQueueMgr_IsCurrentQueue (__dpctl_keep const DPCTLSyclQueueRef QRef)
*/
__dpctl_give DPCTLSyclQueueRef
DPCTLQueueMgr_SetAsDefaultQueue (DPCTLSyclBackendType BETy,
DPCTLSyclDeviceType DeviceTy,
size_t DNum)
DPCTLSyclDeviceType DeviceTy,
size_t DNum)
{
return QMgrHelper::setAsDefaultQueue(BETy, DeviceTy, DNum);
}
Expand All @@ -517,8 +521,8 @@ DPCTLQueueMgr_SetAsDefaultQueue (DPCTLSyclBackendType BETy,
*/
__dpctl_give DPCTLSyclQueueRef
DPCTLQueueMgr_PushQueue (DPCTLSyclBackendType BETy,
DPCTLSyclDeviceType DeviceTy,
size_t DNum)
DPCTLSyclDeviceType DeviceTy,
size_t DNum)
{
return QMgrHelper::pushSyclQueue(BETy, DeviceTy, DNum);
}
Expand All @@ -536,8 +540,10 @@ void DPCTLQueueMgr_PopQueue ()
* SYCL device.
*/
DPCTLSyclQueueRef
DPCTLQueueMgr_GetQueueFromContextAndDevice (__dpctl_keep DPCTLSyclContextRef CRef,
__dpctl_keep DPCTLSyclDeviceRef DRef)
DPCTLQueueMgr_GetQueueFromContextAndDevice (
__dpctl_keep DPCTLSyclContextRef CRef,
__dpctl_keep DPCTLSyclDeviceRef DRef
)
{
auto dev = unwrap(DRef);
auto ctx = unwrap(CRef);
Expand Down
Loading