Skip to content

Commit

Permalink
Bug fix: events: wrongly decoded ~external_ flag
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Nov 21, 2024
1 parent 7689555 commit 9480850
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
## [0.6.0] 2024-10-31
## [0.6.1] current

### Fixed

- Docu-comment typo.
- The flags `cu_event_wait_external` and `cu_event_wait_default` were switched around for `record ?external_` and `wait ?external_` event functions.

## [0.6.0] 2024-11-01

### Added

- `get_free_and_total_mem`.
- Multiple missing `sexp_of` conversions.
- `cuda_call_hook` to help in debugging.
- `is_success` functions.
- `mem_alloc_async` and `mem_free_async`. `mem_free_async` is attached as a finalizer by `mem_alloc_async` (with stream capture).
- `mem_alloc_async` i.e. `Stream.mem_alloc`, and `mem_free_async` i.e. `Stream.mem_free`. `Stream.mem_free` is attached as a finalizer by `Stream.mem_alloc` (with stream capture).

### Changed

Expand Down
4 changes: 2 additions & 2 deletions cudajit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ module Event = struct
let open Cuda_ffi.Types_generated in
let flags =
Unsigned.UInt.of_int64
@@ if external_ then cu_event_record_default else cu_event_record_external
@@ if external_ then cu_event_record_external else cu_event_record_default
in
check "cu_event_record_with_flags" @@ Cuda.cu_event_record_with_flags event stream.stream flags

Expand All @@ -1819,7 +1819,7 @@ module Event = struct
let wait ?(external_ = false) stream event =
let open Cuda_ffi.Types_generated in
let flags =
Unsigned.UInt.of_int64 @@ if external_ then cu_event_wait_default else cu_event_wait_external
Unsigned.UInt.of_int64 @@ if external_ then cu_event_wait_external else cu_event_wait_default
in
check "cu_stream_wait_event" @@ Cuda.cu_stream_wait_event stream.stream event flags
end
Expand Down
4 changes: 3 additions & 1 deletion cudajit.mli
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,9 @@ module Stream : sig
t ->
unit
(** Copies from the device memory into the bigarray (or its interval) asynchronously.
[host_offset] and [length] are in numbers of elements. See {!memcpy_D_to_H_async_unsafe}. *)
[host_offset] and [length] are in numbers of elements. See {!memcpy_D_to_H_unsafe} and
{{:https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g56f30236c7c5247f8e061b59d3268362}
cuMemcpyDtoHAsync}. *)

val memcpy_D_to_D :
?kind:('a, 'b) Bigarray.kind ->
Expand Down

0 comments on commit 9480850

Please sign in to comment.