Add interface to set CU mask

Signed-off-by: Flora Cui <flora.cui@amd.com>
Acked-by: Ben Goz <ben.goz@amd.com>
This commit is contained in:
Flora Cui
2015-06-23 15:25:38 +08:00
parent 29c083f695
commit fc4e07daa3
4 changed files with 52 additions and 1 deletions
+1
View File
@@ -20,6 +20,7 @@ hsaKmtWaitOnMultipleEvents;
hsaKmtCreateQueue;
hsaKmtUpdateQueue;
hsaKmtDestroyQueue;
hsaKmtSetQueueCUMask;
hsaKmtSetMemoryPolicy;
hsaKmtAllocMemory;
hsaKmtFreeMemory;
+30
View File
@@ -339,3 +339,33 @@ hsaKmtDestroyQueue(
return HSAKMT_STATUS_SUCCESS;
}
}
HSAKMT_STATUS
HSAKMTAPI
hsaKmtSetQueueCUMask(
HSA_QUEUEID QueueId, //IN
HSAuint32 CUMaskCount, //IN
HSAuint32* QueueCUMask //IN
)
{
struct queue *q = PORT_UINT64_TO_VPTR(QueueId);
struct kfd_ioctl_set_cu_mask_args args;
CHECK_KFD_OPEN();
if (CUMaskCount == 0 || QueueCUMask == NULL)
return HSAKMT_STATUS_INVALID_PARAMETER;
memset(&args, 0, sizeof(args));
args.queue_id = q->queue_id;
args.num_cu_mask = CUMaskCount;
args.cu_mask_ptr = (uintptr_t)QueueCUMask;
int err = kmtIoctl(kfd_fd, AMDKFD_IOC_SET_CU_MASK, &args);
if (err == -1)
{
return HSAKMT_STATUS_ERROR;
}
return HSAKMT_STATUS_SUCCESS;
}