Skip to content

Commit

Permalink
fix(binaries): Sample lang in binary name
Browse files Browse the repository at this point in the history
  • Loading branch information
mfep committed Jun 4, 2024
1 parent 2680fe9 commit 7a68d97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions samples/core/binaries/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int main(int argc, char *argv[])
if (!diag_opts.quiet) cl_util_print_device_info(device);

/// Try to read binary
program = cl_util_read_binaries(context, &device, 1, "Collatz", &error);
program = cl_util_read_binaries(context, &device, 1, "Collatz-c", &error);

if (error != CL_SUCCESS)
{ // if binary not present, compile and save
Expand All @@ -207,7 +207,7 @@ int main(int argc, char *argv[])
OCLERROR_RET(cl_util_build_program(program, device, options), error,
prgs);

OCLERROR_RET(cl_util_write_binaries(program, "Collatz"), error, prgs);
OCLERROR_RET(cl_util_write_binaries(program, "Collatz-c"), error, prgs);
printf("Binary file written.\n\n");

prgs:
Expand All @@ -216,7 +216,7 @@ int main(int argc, char *argv[])
free(kernel);

OCLERROR_PAR(program = cl_util_read_binaries(context, &device, 1,
"Collatz", &error),
"Collatz-c", &error),
error, cont);
}

Expand Down
5 changes: 3 additions & 2 deletions samples/core/binaries/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ int main(int argc, char* argv[])
try
{
/// Try to read binary
binaries = cl::util::read_binary_files(devices, "Collatz", &error);
binaries =
cl::util::read_binary_files(devices, "Collatz-cpp", &error);
} catch (cl::util::Error& e)
{
// if binary not present, compile and save
Expand All @@ -106,7 +107,7 @@ int main(int argc, char* argv[])
program.build(devices.at(0));

binaries = program.getInfo<CL_PROGRAM_BINARIES>(&error);
cl::util::write_binaries(binaries, devices, "Collatz");
cl::util::write_binaries(binaries, devices, "Collatz-cpp");
}

// if the binary is already present - calculate
Expand Down

0 comments on commit 7a68d97

Please sign in to comment.