@@ -4888,6 +4888,41 @@ TEST(PopulateArgDescriptorCrossthreadPayload, GivenArgTypeWorkDimensionsWhenSize
48884888 EXPECT_EQ (32U , programInfo.kernelInfos [0 ]->kernelDescriptor .payloadMappings .dispatchTraits .workDim );
48894889}
48904890
4891+ TEST (PopulateArgDescriptorCrossthreadPayload, GivenArgTypeImplicitArgBufferWhenPopulatingKernelDescriptorThenProperOffsetIsSetAndImplicitArgsAreRequired) {
4892+ NEO::ConstStringRef zeinfo = R"===(
4893+ kernels:
4894+ - name : some_kernel
4895+ execution_env:
4896+ simd_size: 32
4897+ payload_arguments:
4898+ - arg_type: implicit_arg_buffer
4899+ offset: 4
4900+ size: 8
4901+ )===" ;
4902+ NEO::ProgramInfo programInfo;
4903+ ZebinTestData::ValidEmptyProgram zebin;
4904+ zebin.appendSection (NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::textPrefix.str () + " some_kernel" , {});
4905+ std::string errors, warnings;
4906+ auto elf = NEO::Elf::decodeElf (zebin.storage , errors, warnings);
4907+ ASSERT_NE (nullptr , elf.elfFileHeader ) << errors << " " << warnings;
4908+
4909+ NEO::Yaml::YamlParser parser;
4910+ bool parseSuccess = parser.parse (zeinfo, errors, warnings);
4911+ ASSERT_TRUE (parseSuccess) << errors << " " << warnings;
4912+
4913+ NEO::ZebinSections zebinSections;
4914+ auto extractErr = NEO::extractZebinSections (elf, zebinSections, errors, warnings);
4915+ ASSERT_EQ (NEO::DecodeError::Success, extractErr) << errors << " " << warnings;
4916+
4917+ auto &kernelNode = *parser.createChildrenRange (*parser.findNodeWithKeyDfs (" kernels" )).begin ();
4918+ auto err = NEO::populateKernelDescriptor (programInfo, elf, zebinSections, parser, kernelNode, errors, warnings);
4919+ EXPECT_EQ (NEO::DecodeError::Success, err);
4920+ EXPECT_TRUE (errors.empty ()) << errors;
4921+ EXPECT_TRUE (warnings.empty ()) << warnings;
4922+ EXPECT_EQ (4u , programInfo.kernelInfos [0 ]->kernelDescriptor .payloadMappings .implicitArgs .implcitArgsBuffer );
4923+ EXPECT_TRUE (programInfo.kernelInfos [0 ]->kernelDescriptor .kernelAttributes .flags .requiresImplicitArgs );
4924+ }
4925+
48914926TEST (PopulateArgDescriptorCrossthreadPayload, GivenArgTypeWorkDimensionsWhenSizeIsInvalidThenPopulateKernelDescriptorFails) {
48924927 NEO::KernelDescriptor kernelDescriptor;
48934928 kernelDescriptor.payloadMappings .explicitArgs .resize (1 );
0 commit comments