Skip to content

Commit

Permalink
Release 10.120
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuernber committed Nov 16, 2024
1 parent c4fbd8e commit cc4630f
Show file tree
Hide file tree
Showing 41 changed files with 107 additions and 85 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 10.120
* Fixed sub-buffer of indexed buffers throwing exception.

## 10.114
* [issue-100](https://github.com/cnuernber/dtype-next/issues/100) - Support latest neanderthal.

Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:exec-fn codox.main/-main
:exec-args {:group-id "cnuernber"
:artifact-id "dtype-next"
:version "10.119"
:version "10.120"
:name "DType Next"
:description "High Performance Clojure Primitives"
:metadata {:doc/format :markdown}
Expand Down
2 changes: 1 addition & 1 deletion docs/buffered-image.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/cheatsheet.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/datatype-to-dtype-next.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dimensions-bytecode-gen.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/overview.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.argops.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.bitmap.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.convolve.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.datetime.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.errors.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.ffi.clang.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.ffi.graalvm.html

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions docs/tech.v3.datatype.ffi.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.ffi.size-t.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.functional.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.gradient.html

Large diffs are not rendered by default.

37 changes: 21 additions & 16 deletions docs/tech.v3.datatype.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.list.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.mmap-writer.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.mmap.html

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions docs/tech.v3.datatype.native-buffer.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.nippy.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.packing.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.reductions.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.rolling.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.sampling.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.statistics.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.struct.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.datatype.wavelet.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.libs.buffered-image.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.parallel.for.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.parallel.queue-iter.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.tensor.color-gradients.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.tensor.dimensions.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tech.v3.tensor.html

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions src/tech/v3/datatype.clj
Original file line number Diff line number Diff line change
Expand Up @@ -500,23 +500,25 @@ user> (dtype/make-reader :float32 5 (* idx 2))

(defn malloc
"Malloc memory. If a desired buffer type is needed follow up with set-native-datatype.
* n-bytes - the number of bytes to malloc
* opts - Either a keyword datatype or an options map.
Options:
* `:resource-type` - defaults to `:gc` - maps to `:track-type` in `tech.v3.resource/track`
but can also be set to nil in which case the data is not tracked this library will
not clean it up.
* `:datatype` - Datatype - defaults to :int8. Datatype byte width must evenly divide n-bytes.
* `:uninitialized?` - do not initialize to zero. Use for perf in very very rare cases.
* `:endianness` - Either `:little-endian` or `:big-endian` - defaults to platform.
* `:log-level` - one of `#{:debug :trace :info :warn :error :fatal}` or nil if no logging
is desired. When enabled allocations and frees will be logged in the same manner as
`tech.jna`."
(^{:tag tech.v3.datatype.native_buffer.NativeBuffer} [n-bytes opts]
(tech.v3.datatype.native-buffer/malloc n-bytes opts))
(^{:tag tech.v3.datatype.native_buffer.NativeBuffer} [n-bytes dtype-or-opts]
(tech.v3.datatype.native-buffer/malloc n-bytes dtype-or-opts))
(^{:tag tech.v3.datatype.native_buffer.NativeBuffer} [n-bytes]
(tech.v3.datatype.native-buffer/malloc n-bytes))
(^{:tag tech.v3.datatype.native_buffer.NativeBuffer} [n-bytes dtype opts]
(tech.v3.datatype.native-buffer/malloc n-bytes dtype opts)))
(tech.v3.datatype.native-buffer/malloc n-bytes)))


(defn prealloc-list
Expand Down
2 changes: 1 addition & 1 deletion src/tech/v3/datatype_api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
(.invokePrim ^IFn$LO read-fn idx))
(subBuffer [rdr sidx eidx]
(ChunkedList/sublistCheck sidx eidx n-elems)
(make-reader-fn advertised-datatype (- eidx sidx)
(make-reader-fn datatype advertised-datatype (- eidx sidx)
(reify IFnDef$LO
(invokePrim [this idx]
(.invokePrim ^IFn$LO read-fn (+ sidx idx))))))
Expand Down
7 changes: 7 additions & 0 deletions test/tech/v3/datatype_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[tech.v3.datatype.gradient :as dt-grad]
[tech.v3.datatype.wavelet]
[tech.v3.datatype.datetime]
[tech.v3.datatype.io-indexed-buffer :as idxbuf]
[ham-fisted.lazy-noncaching :as lznc]
[ham-fisted.api :as hamf]
[ham-fisted.protocols :as hamf-proto]
Expand Down Expand Up @@ -867,6 +868,12 @@
(is (= [false false true true] (dfn/> [1.0 2.0 3.0 4.0] 2))))


(deftest indexed-sub-buffer
(let [data (vec (range 10))
idxbuf (idxbuf/indexed-buffer [2 4 6 8] data)]
(is (= [6 8] (dtype/sub-buffer idxbuf 2 2)))))


(comment
(defn bench-sum
[]
Expand Down

0 comments on commit cc4630f

Please sign in to comment.