Skip to content

Commit 4f59d0d

Browse files
committed
Small bug fix
1 parent 2abda4e commit 4f59d0d

File tree

1 file changed

+9
-0
lines changed
  • librapid/bindings/generators

1 file changed

+9
-0
lines changed

librapid/bindings/generators/main.py

+9
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,18 @@
2525
""").strip()
2626

2727
postBoilerplate = textwrap.dedent(f"""
28+
#if defined(LIBRAPID_HAS_OPENCL)
2829
module.def("configureOpenCL", [](bool verbose, bool ask) {{
2930
lrc::configureOpenCL(verbose, ask);
3031
}}, py::arg("verbose") = false, py::arg("ask") = false);
32+
#else
33+
module.def("configureOpenCL", [](bool verbose, bool ask) {{
34+
throw std::runtime_error("OpenCL is not supported in this build "
35+
"of LibRapid. Please ensure OpenCL is "
36+
"installed on your system and reinstall "
37+
"LibRapid from source.");
38+
}}, py::arg("verbose") = false, py::arg("ask") = false);
39+
#endif
3140
3241
module.def("hasOpenCL", []() {{
3342
#if defined(LIBRAPID_HAS_OPENCL)

0 commit comments

Comments
 (0)