94 Commits

Author SHA1 Message Date
Brook Heisler
3e462424da Fix warning. 2021-07-28 16:28:15 -06:00
Brook Heisler
3cae1d3336 Add test for new uuid function, fix doctest. 2021-07-28 16:27:50 -06:00
Brook Heisler
e995020318 Update DeviceAttribute enum to match cuda-driver-sys. 2021-07-28 16:26:51 -06:00
Volker Mische
7f375af367 Add support for getting the UUID of a device
`Device::uuid()` was added to get the UUID of a device via the underlying
`cuDevuceGetUuid()` call.
2021-07-07 13:06:11 +02:00
Volker Mische
f1fa04fb5d Upgrade to latest cuda-sys
`cuda-sys` was split into several crates with the release of version 0.3.
For RustaCUDA, the `cuda-driver-sys` crate is used, which contains all
the functionality that is currently needed.
2021-07-07 13:05:57 +02:00
Brook Heisler
442f74000c Add unit tests for Device/UnifiedPtr impls. 2020-02-29 10:54:15 -06:00
Brook Heisler
85d16ab4d1 Add nightly-rust build to Travis 2020-02-29 10:07:22 -06:00
Federico Pasqua
89eb908001 Merge branch 'master' into fix_ci 2020-01-03 13:36:58 +01:00
Federico Pasqua
ec036ffa61 Fix space artifact in documentation
Some space in the documentation will make the 
`cargo fmt --all -- --check` fail.
2019-12-31 21:35:06 +01:00
Federico Pasqua
8d3a1ee808 Add #Safety for all the remnaint unsafe function
This fix the last `clippy::missing-safety-doc`warning.
This is needed for a working CI.
2019-12-31 20:50:22 +01:00
Federico Pasqua
e642541046 Fix documentation removing ":" from section names
Without this fix the command `cargo clippy --all -- -D warnings` from
the CI will fail because the lint `clippy::missing-safety-doc` search
for "# Safety" and not "# Safety:".
Even "# Examples" and "# Errors" have seen the ":" removed.
2019-12-31 20:07:17 +01:00
Federico Pasqua
2a1e23022b Use mem::MaybeUninit instead of mem::uninitialized
mem::uninitialized is now (Rust 1.40) deprecated in favor of the use
of mem::MaybeUninit
2019-12-31 19:50:11 +01:00
Federico Pasqua
7bc6397d40 Remove fn main() from Doctests in rustacuda
See the warning clippy::needless-doctest-main for more information.
2019-12-30 19:36:18 +01:00
Andrew Gaspar
fb223ef4dd Replace uninitialized with MaybeUninit 2019-12-29 12:46:33 -07:00
Brook Heisler
9aa08a0a61 Remove unified allocation size test.
It tries to allocate 3/4 of the device memory as a unified buffer, but there's no guarantee that there's that much page-locked CPU memory to match, so that doesn't really work.
2019-06-13 19:02:46 -06:00
Brook Heisler
e95df86d16 Merge pull request #38 from LutzCle/fix-oversize-malloc
Fix memory over-allocation bugs
2019-06-13 19:01:57 -06:00
Clemens Lutz
d0d6e7bda3 Fix memory over-allocation bugs
`DeviceBuffer`, `LockedBuffer`, and `UnifiedBuffer` allocate several times
more memory than requested. This occurs because the respective `*_malloc()`
wrappers already account for the scaling from "count of T" to bytes. Thus,
count is multiplied with `size_of::<T>()` twice.

This fix simply removes the superfluous multiplication.
2019-06-12 14:56:23 +02:00
Clemens Lutz
63b4ab6cab Add tests to check the size of memory allocations 2019-06-12 14:56:23 +02:00
Brook Heisler
e5068ea38a Adjust documentation, fix broken doctest. 2019-05-16 18:42:53 -06:00
Clemens Lutz
e97f87bba6 Add Stream::wait_event 2019-05-09 19:51:09 +02:00
Clemens Lutz
33ce29673b Add CUDA Event 2019-05-09 19:51:09 +02:00
Brook Heisler
cb29ff6d56 Fix clippy warnings. 2019-05-06 19:20:59 -06:00
Brook Heisler
da464c79cf Fix NUL bytes left in device name string. 2019-05-06 18:25:27 -06:00
Brook Heisler
2205c42974 Adjust wording of documentation on the AsyncCopyDestination trait 2019-04-09 18:32:21 -06:00
Brook Heisler
dbbbf793fb Merge pull request #20 from rusch95/async_unsafe
Implement unsafe async interface
2019-04-09 18:26:48 -06:00
Clemens Lutz
c6a29ed3d7 Fix compile error on ppc64 architecture
c_char is defined as u8 on ppc64, whereas it's defined as i8 on x86_64.
Using c_char directly solves the problem.
2019-03-21 19:14:31 +01:00
Robert Rusch
765216df03 Implement unsafe layer 2019-01-28 13:01:26 -05:00
Brook Heisler
55f4aabd13 Fix clippy warnings.
Honestly not sure if it's more readable or less now, but it's probably fine.
2019-01-22 19:02:52 -06:00
Brook Heisler
d3fd51bcce Fix some warnings in the tests. 2019-01-22 18:47:47 -06:00
Jeremy Francis
f99084d4dc Remove unwrap from examples (#27)
* test

* test2

* cleaning up .unwraps()

* cleaning up spacing

* removed more unwraps

* removed all?? the unwraps

* removed all?? the unwraps

* All unwrap() calls removed.

* Refactor device.rs into smaller files

* test

cleaning up .unwraps()

cleaning up spacing

removed more unwraps

removed all?? the unwraps

removed all?? the unwraps

branch cleanup

* Removed .unwrap() calls from src/device.rs

* Removed .unwarp() calls from src/function.rs

* Removed unwrap() calls from src/module.rs

* Removed unwrap() calls from module.rs & stream.rs

* Removed unwrap() calls from #[test]s in module.rs

* Removed unwrap() calls from #[test]s in both function.rs & device.rs

* Removed all .unwrap() calls from examples in src/...

* rustfmt cleanups

* Removed duplicate crate imports, more Rustfmt adjusments

* Cleaning up Formatting
2019-01-22 18:46:01 -06:00
Brook Heisler
f8466a0bee Merge pull request #22 from AndrewGaspar/arrays
Support Creation and Management of CUDA Arrays in RustaCUDA
2019-01-22 18:35:28 -06:00
Andrew Gaspar
68a1099243 Enhancements to CUDA generic array interface
- Move array types to array module under memory
- Remove builder and unnecessary getter/setter routines from flags type
- Make dbg mode ArrayObject::from_descriptor checking more robust
- Fix names of some device attributes
- New named constructors for ArrayObject
- Documentation and tests for all routines
2019-01-15 23:05:10 -07:00
Brook Heisler
942409028f Minor tweaks to context examples and docs. 2018-12-29 14:27:51 -06:00
Jeremy Francis
1f533f1609 Remove unwrap()s from context.rs (#26)
* test

* test2

* cleaning up .unwraps()

* cleaning up spacing

* removed more unwraps

* removed all?? the unwraps

* All unwrap() calls removed.
2018-12-29 14:14:40 -06:00
Andrew Gaspar
7340a75d5e Adds types and routines for creating CUDA Arrays
The primary new type is ArrayObject, which represents a generic array
with up to 3-dimensions.

An ArrayObject has a set of dimensions, an ArrayFormat, a number of
channels (1, 2, or 4), and a set of ArrayObjectFlags

Adds tests that assert correct ArrayObject values are accepted and that
bad ones are rejected with a panic.
2018-12-16 23:15:43 -07:00
Robert Rusch
7748fe6d6e Refactor device.rs into smaller files 2018-12-10 22:01:02 -05:00
Robert Rusch
3eeef1bd34 Bump to Rust 2018 2018-12-06 18:21:29 -05:00
Robert Rusch
23c0ae36bf Expose Stream Callbacks
Wrap cuStreamAddCallback allowing users to pass it closures.
2018-12-03 20:28:56 -05:00
Brook Heisler
7dd40c2ce0 Put core types in the root of the core crate. 2018-12-01 09:55:24 -06:00
Brook Heisler
56f241600d Improvements to RustaCUDA after dogfooding it in my path tracer. 2018-12-01 08:20:13 -06:00
Brook Heisler
6b076722d5 Rename Module::load and load_data, update examples. 2018-11-27 19:58:42 -06:00
Brook Heisler
cd00d4b6b8 Re-export rustacuda_derive so users don't need to depend on both. 2018-11-27 19:45:51 -06:00
Brook Heisler
ec1fbb124a Rename rustacuda_macros to rustacuda_derive 2018-11-27 19:37:47 -06:00
Brook Heisler
75a508cb93 Add contributor docs, empty changelog, updated README, minor documentation changes. 2018-11-27 19:28:47 -06:00
Brook Heisler
db35f2ca5a Add Travis-CI shield to README. 2018-11-25 17:02:32 -06:00
Brook Heisler
78f299384d Set up Travis-CI to ensure that everything builds. 2018-11-25 16:57:25 -06:00
Brook Heisler
3b595c6e05 Add prelude. 2018-11-25 12:53:25 -06:00
Brook Heisler
6e59248949 Add crate-level documentation and example. 2018-11-25 12:40:59 -06:00
Brook Heisler
3d0f8342f1 More minor documentation fixes. 2018-11-25 11:48:27 -06:00
Brook Heisler
8a629055e9 Remove private.rs, move to private module. Also some improvements to docs. 2018-11-25 11:19:56 -06:00