Skip to content

Commit 3655768

Browse files
wpanZuul
authored and
Zuul
committed
Handle local size and group count.
Change-Id: Ic3c77750f7306913c1bac4dae33c78ae69d3ad8c
1 parent febe5f4 commit 3655768

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

IGC/AdaptorOCL/cmc.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ void CMKernel::createBufferStatefulAnnotation(unsigned argNo)
174174
m_kernelInfo.m_constantInputAnnotation.push_back(constInput);
175175
}
176176

177-
void CMKernel::createLocalSizeAnnotation(unsigned payloadPosition)
177+
void CMKernel::createSizeAnnotation(unsigned payloadPosition, int32_t Type)
178178
{
179179
for (int i = 0; i < 3; ++i) {
180180
iOpenCL::ConstantInputAnnotation* constInput = new iOpenCL::ConstantInputAnnotation;
181181
DWORD sizeInBytes = iOpenCL::DATA_PARAMETER_DATA_SIZE;
182182

183183
constInput->AnnotationSize = sizeof(constInput);
184-
constInput->ConstantType = iOpenCL::DATA_PARAMETER_ENQUEUED_LOCAL_WORK_SIZE;
184+
constInput->ConstantType = Type;
185185
constInput->Offset = i * sizeInBytes;
186186
constInput->PayloadPosition = payloadPosition;
187187
constInput->PayloadSizeInBytes = sizeInBytes;
@@ -325,6 +325,12 @@ static void generatePatchTokens(const cmc_kernel_info *info, CMKernel& kernel)
325325
case cmc_arg_kind::General:
326326
kernel.createConstArgumentAnnotation(AI.index, AI.offset - constantPayloadStart, AI.sizeInBytes);
327327
break;
328+
case cmc_arg_kind::LocalSize:
329+
kernel.createSizeAnnotation(AI.offset - constantPayloadStart, iOpenCL::DATA_PARAMETER_ENQUEUED_LOCAL_WORK_SIZE);
330+
break;
331+
case cmc_arg_kind::GroupCount:
332+
kernel.createSizeAnnotation(AI.offset - constantPayloadStart, iOpenCL::DATA_PARAMETER_NUM_WORK_GROUPS);
333+
break;
328334
case cmc_arg_kind::Buffer:
329335
kernel.createPointerGlobalAnnotation(AI.index, AI.sizeInBytes, AI.offset - constantPayloadStart, AI.BTI);
330336
kernel.createBufferStatefulAnnotation(AI.index);
@@ -445,8 +451,11 @@ int cmc::vISACompile(cmc_compile_info* output, iOpenCL::CGen8CMProgram& CMProgra
445451
unsigned genBinarySize = 0;
446452
FINALIZER_INFO JITInfo;
447453
// TODO: take commond line options.
448-
int numArgs = 0;
449-
const char** args = nullptr;
454+
const char* args[] = {
455+
"-noschedule",
456+
"-nopresched"
457+
};
458+
int numArgs = sizeof(args)/sizeof(args[0]);
450459
status = JITCompile(info->name.c_str(), output->binary, (unsigned)output->binary_size, genBinary,
451460
genBinarySize, platformStr, output->visa_major_version,
452461
output->visa_minor_version, numArgs, args, nullptr, &JITInfo);

IGC/AdaptorOCL/cmc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class CMKernel {
7373
// add a stateful buffer patch token.
7474
void createBufferStatefulAnnotation(unsigned argNo);
7575

76-
// LocalID{x,y,z}
77-
void createLocalSizeAnnotation(unsigned payloadPosition);
76+
// Local or global size
77+
void createSizeAnnotation(unsigned payloadPosition, int32_t type);
7878

7979
// Global work offset/local work size
8080
void createImplicitArgumentsAnnotation(unsigned payloadPosition);

IGC/AdaptorOCL/igcmc.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ enum class cmc_access_kind : int32_t {
3636
};
3737

3838
enum class cmc_arg_kind : int32_t {
39-
General = 0,
40-
Buffer,
41-
SVM,
39+
General,
40+
LocalSize, // IMPLICIT_LOCAL_SIZE
41+
GroupCount, // IMPLICIT_NUM_GROUPS
42+
Buffer, // 1D buffer
43+
SVM, // stateless global pointer
4244
Sampler,
4345
Image1d,
4446
Image2d,

0 commit comments

Comments
 (0)