Skip to content

Commit

Permalink
Use updated LoadProgram(), SaveBinary() and LoadBinary() (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher Erb <Christopher.Erb@amd.com>
  • Loading branch information
averinevg and cderb authored Jan 3, 2024
1 parent 66bd0d4 commit a398088
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/include/bn_fin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ int BNFin<Tgpu, Tref>::MIOpenFindCompile()
{
json kernel;
auto comp_opts = k.comp_options;
auto p = handle.LoadProgram(k.kernel_file, comp_opts, false, "");
auto p = handle.LoadProgram(k.kernel_file, comp_opts, "");
const auto hsaco = p.IsCodeObjectInMemory()
? p.GetCodeObjectBlob()
: miopen::LoadFile(p.GetCodeObjectPathname().string());
Expand Down
8 changes: 3 additions & 5 deletions src/include/conv_fin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,7 @@ int ConvFin<Tgpu, Tref>::MIOpenPerfEval()
h.GetTargetProperties(),
h.GetMaxComputeUnits(),
kernel_file_no_ext,
comp_opts,
false);
comp_opts);
}
else
{
Expand Down Expand Up @@ -1030,8 +1029,7 @@ int ConvFin<Tgpu, Tref>::MIOpenFind()
comp_opts = k.comp_options + " -mcpu=" + arch;
}

const auto hsaco =
miopen::LoadBinary(tgt_props, num_cu, k.kernel_file, comp_opts, false);
const auto hsaco = miopen::LoadBinary(tgt_props, num_cu, k.kernel_file, comp_opts);
if(hsaco.empty())
throw std::runtime_error("Got empty code object");
// Compress the blob
Expand Down Expand Up @@ -1574,7 +1572,7 @@ int ConvFin<Tgpu, Tref>::SearchPreCompiledKernels()
json cdobj_result;
auto comp_opts = k.comp_options;
const auto hsaco = miopen::LoadBinary(
tgt_props, num_cu, k.kernel_file, comp_opts + " -mcpu=" + arch, false);
tgt_props, num_cu, k.kernel_file, comp_opts + " -mcpu=" + arch);
if(hsaco.empty())
{
std::cout << "!!!FAILURE !!! - Kernel Db is not present" << std::endl;
Expand Down
5 changes: 2 additions & 3 deletions src/include/fin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ class BaseFin
auto hsaco = miopen::LoadBinary(handle.GetTargetProperties(),
handle.GetMaxComputeUnits(),
kern.kernel_file,
comp_opts,
false);
comp_opts);

if(hsaco.empty())
{
auto p = handle.LoadProgram(kern.kernel_file, kern.comp_options, false, "");
auto p = handle.LoadProgram(kern.kernel_file, kern.comp_options, "");
hsaco = p.IsCodeObjectInMemory()
? p.GetCodeObjectBlob()
: miopen::LoadFile(p.GetCodeObjectPathname().string());
Expand Down

0 comments on commit a398088

Please sign in to comment.