MCPcopy Create free account
hub / github.com/ROCm/clr / createProgram

Method createProgram

rocclr/device/rocm/rocblit.cpp:820–859  ·  view source on GitHub ↗

================================================================================================

Source from the content-addressed store, hash-verified

818
819// ================================================================================================
820bool KernelBlitManager::createProgram(Device& device) {
821 if (device.blitProgram() == nullptr) {
822 if (!device.createBlitProgram()) {
823 return false;
824 }
825 }
826
827 std::vector<amd::Device*> devices;
828 devices.push_back(&device);
829
830 // Save context and program for this device
831 context_ = device.blitProgram()->context_;
832 context_->retain();
833 program_ = device.blitProgram()->program_;
834 program_->retain();
835
836 bool result = false;
837 do {
838 // Create kernel objects for all blits
839 for (uint i = 0; i < NumBlitKernels(); ++i) {
840 const amd::Symbol* symbol = program_->findSymbol(BlitName[i]);
841 if (symbol == nullptr) {
842 // Not all blit kernels are needed in some setup, so continue with the rest
843 continue;
844 }
845 kernels_[i] = new amd::Kernel(*program_, *symbol, BlitName[i]);
846 if (kernels_[i] == nullptr) {
847 break;
848 }
849 // Validate blit kernels for the scratch memory usage (pre SI)
850 if (!device.validateKernel(*kernels_[i], &gpu())) {
851 break;
852 }
853 }
854
855 result = true;
856 } while (!result);
857
858 return result;
859}
860
861// The following data structures will be used for the view creations.
862// Some formats has to be converted before a kernel blit operation

Callers

nothing calls this directly

Calls 5

blitProgramMethod · 0.80
findSymbolMethod · 0.80
createBlitProgramMethod · 0.45
retainMethod · 0.45
validateKernelMethod · 0.45

Tested by

no test coverage detected