aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-01-15 01:16:47 +0100
committerAndrzej Janik <[email protected]>2021-01-15 01:16:47 +0100
commitb8d1c6a25654ee2dbfdee96342fbe9d3e778c9c4 (patch)
treea76c2ea473f92fef4421e8ef3cba82ad24db5930
parent5cd9a5fbc4b92c58a1db6f205559e690af30481b (diff)
downloadZLUDA-b8d1c6a25654ee2dbfdee96342fbe9d3e778c9c4.tar.gz
ZLUDA-b8d1c6a25654ee2dbfdee96342fbe9d3e778c9c4.zip
Prevent linker from stripping exports on Linuxlinux_linker_hack
-rw-r--r--zluda/src/lib.rs2
-rw-r--r--zluda_lib/src/lib.rs10
2 files changed, 10 insertions, 2 deletions
diff --git a/zluda/src/lib.rs b/zluda/src/lib.rs
index 0f7d014..ed0bf68 100644
--- a/zluda/src/lib.rs
+++ b/zluda/src/lib.rs
@@ -11,6 +11,6 @@ extern crate paste;
extern crate ptx;
#[allow(warnings)]
-mod cuda;
+pub mod cuda;
mod cuda_impl;
pub(crate) mod r#impl;
diff --git a/zluda_lib/src/lib.rs b/zluda_lib/src/lib.rs
index 2022614..a489d98 100644
--- a/zluda_lib/src/lib.rs
+++ b/zluda_lib/src/lib.rs
@@ -1,3 +1,11 @@
pub extern crate zluda;
-pub use zluda::*; \ No newline at end of file
+pub use zluda::cuda::*;
+
+// For some reason, on Linux linker strips out all our re-exports,
+// there's probably a cleaner solution, but for now just exporting
+// the function below stops it from doing so
+#[no_mangle]
+fn _zluda_very_bad_linker_hack() {
+ cuInit(0);
+}