@luma.gl/graph 10.0.0-alpha.12 → 10.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +19 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +6 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +16 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +3 -2
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +3 -2
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs.map +2 -2
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +1539 -211
- package/dist/dist.min.js +401 -105
- package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.js +50 -0
- package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +7 -18
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-reduction.cjs +6 -14
- package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-reduction.js +6 -15
- package/dist/gpu-core/gpu-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
- package/dist/gpu-core/index.cjs +5 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +2 -0
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +1 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +7 -2
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -1
- package/dist/gpu-data/cpu-gpu-vector-transfer.js +9 -6
- package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -1
- package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
- package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-graph/index.cjs +5 -0
- package/dist/gpu-graph/index.cjs.map +3 -3
- package/dist/gpu-graph/index.d.ts +2 -0
- package/dist/gpu-graph/index.d.ts.map +1 -1
- package/dist/gpu-graph/index.js +1 -0
- package/dist/gpu-graph/index.js.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/graph.cjs.map +3 -3
- package/dist/gpu-project/index.cjs.map +2 -2
- package/dist/gpu-simple-graph/index.cjs.map +3 -3
- package/dist/gpu-sql/gpu-sql.cjs +112 -100
- package/dist/gpu-sql/gpu-sql.d.ts +1 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +120 -102
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +2 -2
- package/dist/gpu-tables/index.cjs.map +2 -2
- package/dist/gpu-tables/table/gpu-table.cjs +2 -2
- package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
- package/dist/gpu-tables/table/gpu-table.js +2 -2
- package/dist/gpu-tables/table/gpu-table.js.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +17 -6
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +3 -2
- package/src/gpu-core/gpu-graph-compiler.ts +61 -0
- package/src/gpu-core/gpu-group-aggregation.ts +38 -50
- package/src/gpu-core/gpu-reduction.ts +32 -42
- package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
- package/src/gpu-core/index.ts +6 -0
- package/src/gpu-data/cpu-gpu-vector-transfer.ts +10 -7
- package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
- package/src/gpu-graph/index.ts +9 -0
- package/src/gpu-sql/gpu-sql.ts +130 -103
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +9 -0
package/dist/index.d.ts
CHANGED
|
@@ -33,4 +33,6 @@ export type { GPUGraphTextureDescriptor, GPUGraphTextureExtent } from "./gpu-cor
|
|
|
33
33
|
export type { GPUGraphTextureBinding, GPUGraphOutput, GPUGraphOutputs } from "./gpu-core/gpu-texture-plan.js";
|
|
34
34
|
export { GPUCPUOperation } from "./gpu-core/gpu-cpu-operation.js";
|
|
35
35
|
export type { GPUCPUOperationProps, GPUCPUArray, GPUCPUVector, GPUCPUResult } from "./gpu-core/gpu-cpu-operation.js";
|
|
36
|
+
export { GPUGraphGroupAggregation, GPUGraphReduction } from "./gpu-core/gpu-semantic-aggregation-operation.js";
|
|
37
|
+
export type { GPUGraphGroupAggregationProps, GPUGraphReductionProps } from "./gpu-core/gpu-semantic-aggregation-operation.js";
|
|
36
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,0BAA0B,EAC1B,KAAK,0BAA0B,EAC/B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,E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C1B,oBAAoB,EACpB,uBAAuB,EACxB,6CAA0C;AAC3C,YAAY,EAAC,YAAY,EAAC,oCAAiC;AAE3D,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AACpD,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EAClB,sCAAmC;AACpC,YAAY,EAAC,yBAAyB,EAAC,0CAAuC;AAC9E,YAAY,EACV,8BAA8B,EAC9B,2BAA2B,EAC5B,6CAA0C;AAE3C,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AACvF,OAAO,EAAC,sBAAsB,EAAC,gDAA6C;AAC5E,YAAY,EAAC,2BAA2B,EAAC,gDAA6C;AACtF,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACtB,6CAA0C;AAC3C,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAC3E,YAAY,EAAC,2BAA2B,EAAC,+CAA4C;AAErF,YAAY,EAAC,yBAAyB,EAAE,qBAAqB,EAAC,sCAAmC;AACjG,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,eAAe,EAChB,uCAAoC;AAErC,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAC7D,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,YAAY,EACb,wCAAqC;AAEtC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,yDAAsD;AACvD,YAAY,EACV,6BAA6B,EAC7B,sBAAsB,EACvB,yDAAsD"}
|
package/dist/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export { GPUUploadOperation, GPUCopyOperation } from "./gpu-core/gpu-transfer-op
|
|
|
17
17
|
export { GPUShaderPassOperation } from "./gpu-core/gpu-shader-pass-operation.js";
|
|
18
18
|
export { GPUCompactionOperation } from "./gpu-core/gpu-compaction-operation.js";
|
|
19
19
|
export { GPUCPUOperation } from "./gpu-core/gpu-cpu-operation.js";
|
|
20
|
+
export { GPUGraphGroupAggregation, GPUGraphReduction } from "./gpu-core/gpu-semantic-aggregation-operation.js";
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EAInB,gBAAgB,EAUhB,0BAA0B,EAE1B,gBAAgB,EAqDjB,6BAA0B;AAC3B,OAAO,EACL,iCAAiC,EASjC,wBAAwB,EACzB,kDAA+C;AAChD,OAAO,EAGL,wCAAwC,EACzC,0DAAuD;AACxD,OAAO,EAaL,wBAAwB,EACzB,kDAA+C;AAchD,OAAO,EAAC,cAAc,EAAC,uDAAoD;AAU3E,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,eAAe,EAAC,+CAA4C;AAMpE,OAAO,EAAC,MAAM,EAAC,sCAAmC;AAClD,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAO/D,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAK3E,OAAO,EAAC,gBAAgB,EAAE,yBAAyB,EAAC,yCAAsC;AAe1F,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AAapD,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AACvF,OAAO,EAAC,sBAAsB,EAAC,gDAA6C;AAM5E,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAU3E,OAAO,EAAC,eAAe,EAAC,wCAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,aAAa,EACb,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,EACf,mBAAmB,EAInB,gBAAgB,EAUhB,0BAA0B,EAE1B,gBAAgB,EAqDjB,6BAA0B;AAC3B,OAAO,EACL,iCAAiC,EASjC,wBAAwB,EACzB,kDAA+C;AAChD,OAAO,EAGL,wCAAwC,EACzC,0DAAuD;AACxD,OAAO,EAaL,wBAAwB,EACzB,kDAA+C;AAchD,OAAO,EAAC,cAAc,EAAC,uDAAoD;AAU3E,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,eAAe,EAAC,+CAA4C;AAMpE,OAAO,EAAC,MAAM,EAAC,sCAAmC;AAClD,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAO/D,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAK3E,OAAO,EAAC,gBAAgB,EAAE,yBAAyB,EAAC,yCAAsC;AAe1F,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AAapD,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,6CAA0C;AACvF,OAAO,EAAC,sBAAsB,EAAC,gDAA6C;AAM5E,OAAO,EAAC,sBAAsB,EAAC,+CAA4C;AAU3E,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAQ7D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EAClB,yDAAsD"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "10.0.0-alpha.
|
|
6
|
+
"version": "10.0.0-alpha.13",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"src",
|
|
24
24
|
"dist",
|
|
25
25
|
"dist.min.js",
|
|
26
|
-
"README.md"
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"THIRD-PARTY-NOTICES.md"
|
|
27
29
|
],
|
|
28
30
|
"sideEffects": false,
|
|
29
31
|
"scripts": {
|
|
@@ -240,8 +242,8 @@
|
|
|
240
242
|
}
|
|
241
243
|
},
|
|
242
244
|
"peerDependencies": {
|
|
243
|
-
"@luma.gl/core": "~10.0.0-alpha.
|
|
244
|
-
"@luma.gl/shaders": "~10.0.0-alpha.
|
|
245
|
+
"@luma.gl/core": "~10.0.0-alpha.13",
|
|
246
|
+
"@luma.gl/shaders": "~10.0.0-alpha.13",
|
|
245
247
|
"apache-arrow": ">=17.0.0"
|
|
246
248
|
},
|
|
247
249
|
"peerDependenciesMeta": {
|
|
@@ -250,10 +252,10 @@
|
|
|
250
252
|
}
|
|
251
253
|
},
|
|
252
254
|
"dependencies": {
|
|
253
|
-
"@math.gl/arrow": "~5.0.0-beta.
|
|
254
|
-
"@math.gl/core": "~5.0.0-beta.
|
|
255
|
-
"@math.gl/geospatial": "~5.0.0-beta.
|
|
255
|
+
"@math.gl/arrow": "~5.0.0-beta.7",
|
|
256
|
+
"@math.gl/core": "~5.0.0-beta.7",
|
|
257
|
+
"@math.gl/geospatial": "~5.0.0-beta.7",
|
|
256
258
|
"probe.gl": "^5.0.0"
|
|
257
259
|
},
|
|
258
|
-
"gitHead": "
|
|
260
|
+
"gitHead": "0e04045e4ca306793aa2b6f86065b0560e30967e"
|
|
259
261
|
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {getGPUDataBufferProps} from '../../gpu-data/gpu-data-buffer-props';
|
|
6
|
+
import {Device, type SignedDataType, type VertexFormat} from '@luma.gl/core';
|
|
6
7
|
import {DynamicBuffer} from '@luma.gl/core/dynamic';
|
|
7
8
|
import {
|
|
8
9
|
GPUData,
|
|
@@ -210,7 +211,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
|
|
|
210
211
|
const byteStride = getArrowTypeByteStride(arrowType.indices);
|
|
211
212
|
return new GPUData({
|
|
212
213
|
buffer: new DynamicBuffer(device, {
|
|
213
|
-
usage
|
|
214
|
+
...(bufferProps.usage === undefined
|
|
215
|
+
? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
|
|
216
|
+
: {}),
|
|
214
217
|
...bufferProps,
|
|
215
218
|
data: getArrowDictionaryIndexBufferSource(data as unknown as Data<ArrowUtf8Dictionary>)
|
|
216
219
|
}),
|
|
@@ -227,7 +230,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
|
|
|
227
230
|
if (DataType.isUtf8(arrowType)) {
|
|
228
231
|
return new GPUData({
|
|
229
232
|
buffer: new DynamicBuffer(device, {
|
|
230
|
-
usage
|
|
233
|
+
...(bufferProps.usage === undefined
|
|
234
|
+
? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
|
|
235
|
+
: {}),
|
|
231
236
|
...bufferProps,
|
|
232
237
|
data: getArrowUtf8DataBufferSource(data as Data<Utf8>)
|
|
233
238
|
}),
|
|
@@ -254,7 +259,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
|
|
|
254
259
|
const byteStride = getArrowTypeByteStride(arrowType);
|
|
255
260
|
return new GPUData({
|
|
256
261
|
buffer: new DynamicBuffer(device, {
|
|
257
|
-
usage
|
|
262
|
+
...(bufferProps.usage === undefined
|
|
263
|
+
? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
|
|
264
|
+
: {}),
|
|
258
265
|
...bufferProps,
|
|
259
266
|
data: getArrowVariableLengthAttributeDataBufferSource(
|
|
260
267
|
data as unknown as Data<VariableLengthAttributeArrowType>
|
|
@@ -278,7 +285,9 @@ export function makeGPUDataFromArrowData<T extends DataType>(
|
|
|
278
285
|
const byteStride = getArrowTypeByteStride(arrowType);
|
|
279
286
|
return new GPUData({
|
|
280
287
|
buffer: new DynamicBuffer(device, {
|
|
281
|
-
usage
|
|
288
|
+
...(bufferProps.usage === undefined
|
|
289
|
+
? getGPUDataBufferProps(device, format === 'uint16' ? 'uint16' : 'uint32')
|
|
290
|
+
: {}),
|
|
282
291
|
...bufferProps,
|
|
283
292
|
data: getArrowDataBufferSource(data as unknown as Data<AttributeArrowType>)
|
|
284
293
|
}),
|
|
@@ -385,7 +394,9 @@ export function makeGPUVectorFromArrow<T extends DataType>(
|
|
|
385
394
|
}
|
|
386
395
|
|
|
387
396
|
const buffer = device.createBuffer({
|
|
388
|
-
usage
|
|
397
|
+
...(bufferProps.usage === undefined
|
|
398
|
+
? getGPUDataBufferProps(device, vectorFormat === 'uint16' ? 'uint16' : 'uint32')
|
|
399
|
+
: {}),
|
|
389
400
|
...bufferProps,
|
|
390
401
|
data: getArrowVectorBufferSource(vector as unknown as Vector<AttributeArrowType>)
|
|
391
402
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {Buffer, type Device} from '@luma.gl/core';
|
|
6
|
+
import {getGPUDataBufferProps} from '../../gpu-data/gpu-data-buffer-props';
|
|
6
7
|
import {DynamicBuffer} from '@luma.gl/core/dynamic';
|
|
7
8
|
import {
|
|
8
9
|
GPUData,
|
|
@@ -707,7 +708,7 @@ async function convertArrowFloat64VectorOnGPU(
|
|
|
707
708
|
const outputBuffer = device.createBuffer({
|
|
708
709
|
...options.bufferProps,
|
|
709
710
|
id: `${options.name}-${chunkIndex}`,
|
|
710
|
-
|
|
711
|
+
...getGPUDataBufferProps(device),
|
|
711
712
|
byteLength: Math.max(Float32Array.BYTES_PER_ELEMENT, split.byteLength)
|
|
712
713
|
});
|
|
713
714
|
outputBuffers.push(outputBuffer);
|
|
@@ -846,7 +847,7 @@ async function convertArrowNumericVectorOnGPU(
|
|
|
846
847
|
const outputBuffer = device.createBuffer({
|
|
847
848
|
...options.bufferProps,
|
|
848
849
|
id: `${options.name}-${chunkIndex}`,
|
|
849
|
-
|
|
850
|
+
...getGPUDataBufferProps(device, targetElementFormat === 'uint16' ? 'uint16' : 'uint32'),
|
|
850
851
|
byteLength: Math.max(4, converted.byteLength)
|
|
851
852
|
});
|
|
852
853
|
outputBuffers.push(outputBuffer);
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import {lowerGPUUpload, lowerGPUCopy, lowerGPUTextureCopy} from './gpu-transfer-lowering';
|
|
6
6
|
import {GPUUploadOperation, GPUCopyOperation} from './gpu-transfer-operation';
|
|
7
7
|
import {GPUCompactionOperation} from './gpu-compaction-operation';
|
|
8
|
+
import {GPUGraphGroupAggregation, GPUGraphReduction} from './gpu-semantic-aggregation-operation';
|
|
9
|
+
import {GPUGroupAggregation} from './gpu-group-aggregation';
|
|
10
|
+
import {GPUReduction} from './gpu-reduction';
|
|
8
11
|
import {GPUCompaction} from './gpu-compaction';
|
|
9
12
|
|
|
10
13
|
import type {TextureFormat} from '@luma.gl/core';
|
|
@@ -108,6 +111,7 @@ export class GPUGraphCompiler<Parameters = void> {
|
|
|
108
111
|
readonly capabilities: GPUGraphBackendCapabilities;
|
|
109
112
|
readonly lowerings: readonly GPUOperationLowering<Parameters>[];
|
|
110
113
|
private compactionIndex = 0;
|
|
114
|
+
private aggregationIndex = 0;
|
|
111
115
|
constructor(device: Device, lowerings: readonly GPUOperationLowering<Parameters>[] = []) {
|
|
112
116
|
this.device = device;
|
|
113
117
|
this.capabilities = Object.freeze({
|
|
@@ -131,6 +135,7 @@ export class GPUGraphCompiler<Parameters = void> {
|
|
|
131
135
|
}
|
|
132
136
|
compile(program: GPUGraph, bindings: GPUGraphBindings = {}): GPUGraphCompilation<Parameters> {
|
|
133
137
|
this.compactionIndex = 0;
|
|
138
|
+
this.aggregationIndex = 0;
|
|
134
139
|
// Bound external partitions must be available when resolving shape-inheriting results.
|
|
135
140
|
program = program.clone();
|
|
136
141
|
for (const vector of program.vectors) {
|
|
@@ -336,6 +341,54 @@ export class GPUGraphCompiler<Parameters = void> {
|
|
|
336
341
|
return [
|
|
337
342
|
{type: 'vector-upload', lower: lowerGPUUpload},
|
|
338
343
|
{type: 'vector-copy', lower: lowerGPUCopy},
|
|
344
|
+
{
|
|
345
|
+
type: 'group-aggregation',
|
|
346
|
+
lower: (operation: GPUGraphGroupAggregation, context) => {
|
|
347
|
+
const {props} = operation;
|
|
348
|
+
const id = `${operation.id}-${this.aggregationIndex++}`;
|
|
349
|
+
const keys = context.resolveVector<'uint32'>(props.keys);
|
|
350
|
+
const mask = props.mask ? context.resolveVector<'uint32'>(props.mask) : undefined;
|
|
351
|
+
if (props.operation === 'count') {
|
|
352
|
+
context.graph.add(
|
|
353
|
+
new GPUGroupAggregation({
|
|
354
|
+
id,
|
|
355
|
+
keys,
|
|
356
|
+
mask,
|
|
357
|
+
operation: 'count',
|
|
358
|
+
output: getAggregationOutput(context.resolveVector<'uint32'>(props.output))
|
|
359
|
+
})
|
|
360
|
+
);
|
|
361
|
+
} else {
|
|
362
|
+
context.graph.add(
|
|
363
|
+
new GPUGroupAggregation({
|
|
364
|
+
id,
|
|
365
|
+
keys,
|
|
366
|
+
mask,
|
|
367
|
+
operation: props.operation,
|
|
368
|
+
values: context.resolveVector<'float32'>(props.values),
|
|
369
|
+
output: getAggregationOutput(context.resolveVector<'float32'>(props.output))
|
|
370
|
+
})
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
type: 'reduction',
|
|
377
|
+
lower: (operation: GPUGraphReduction, context) => {
|
|
378
|
+
const {props} = operation;
|
|
379
|
+
context.graph.add(
|
|
380
|
+
new GPUReduction({
|
|
381
|
+
id: `${operation.id}-${this.aggregationIndex++}`,
|
|
382
|
+
input: context.resolveVector<'uint32' | 'sint32' | 'float32'>(props.input),
|
|
383
|
+
mask: props.mask ? context.resolveVector<'uint32'>(props.mask) : undefined,
|
|
384
|
+
operation: props.operation,
|
|
385
|
+
output: getAggregationOutput(
|
|
386
|
+
context.resolveVector<'uint32' | 'sint32' | 'float32'>(props.output)
|
|
387
|
+
)
|
|
388
|
+
})
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
},
|
|
339
392
|
{
|
|
340
393
|
type: 'compaction',
|
|
341
394
|
lower: (operation: GPUCompactionOperation, context) => {
|
|
@@ -760,3 +813,11 @@ function getTransientChunkLengths(
|
|
|
760
813
|
}
|
|
761
814
|
return lengths;
|
|
762
815
|
}
|
|
816
|
+
|
|
817
|
+
// These reduction kernels write one packed destination, never just the first of several chunks.
|
|
818
|
+
function getAggregationOutput<Format extends 'uint32' | 'sint32' | 'float32'>(
|
|
819
|
+
output: GraphVectorView<Format>
|
|
820
|
+
) {
|
|
821
|
+
assert(output.data.length === 1);
|
|
822
|
+
return output.data[0];
|
|
823
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {alignGraphVectorViews} from './graph-vector-view-utils';
|
|
6
6
|
|
|
7
|
+
import {setGPUComputeDispatchWorkgroups} from './gpu-command-dispatch-metadata';
|
|
7
8
|
import {type GPUCommandNode, createGPUComputeCommandNode} from './gpu-command-node';
|
|
8
9
|
import {type Binding} from '@luma.gl/core';
|
|
9
10
|
import {Kernel} from '../execution/compute/kernel';
|
|
@@ -739,56 +740,43 @@ function addKernelPass<Parameters>(
|
|
|
739
740
|
dispatchSize?: GPUGroupAggregationDispatchLayout;
|
|
740
741
|
}
|
|
741
742
|
): readonly GPUCommandNode<Parameters>[] {
|
|
742
|
-
const
|
|
743
|
-
const maximumWorkgroupCount =
|
|
744
|
-
|
|
745
|
-
:
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
743
|
+
const {x, y, z} = props.dispatchSize ?? {x: props.dispatchCount ?? 1, y: 1, z: 1};
|
|
744
|
+
const maximumWorkgroupCount = x * y * z;
|
|
745
|
+
const node = createGPUComputeCommandNode<Parameters>({
|
|
746
|
+
id: props.id,
|
|
747
|
+
resources: props.resources,
|
|
748
|
+
workload: {
|
|
749
|
+
operation: 'GPUGroupAggregation',
|
|
750
|
+
commandCount: 1,
|
|
751
|
+
maximumWorkgroupCount,
|
|
752
|
+
maximumInvocationCount: maximumWorkgroupCount * GROUP_AGGREGATION_WORKGROUP_SIZE
|
|
753
|
+
},
|
|
754
|
+
compile: ({device}) => {
|
|
755
|
+
const kernel = new Kernel(device, {
|
|
756
|
+
id: props.id,
|
|
757
|
+
source: props.source,
|
|
758
|
+
shaderLayout: {
|
|
759
|
+
bindings: Object.keys(props.bindings).map((name, location) => ({
|
|
760
|
+
name,
|
|
761
|
+
type: 'storage' as const,
|
|
762
|
+
group: 0,
|
|
763
|
+
location
|
|
764
|
+
}))
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
return {
|
|
768
|
+
encode: ({computePass, getBuffer}) => {
|
|
769
|
+
const bindings: Record<string, Binding> = {};
|
|
770
|
+
for (const [name, view] of Object.entries(props.bindings)) {
|
|
771
|
+
bindings[name] = getViewBinding(view, getBuffer);
|
|
767
772
|
}
|
|
768
|
-
});
|
|
769
|
-
return {
|
|
770
|
-
encode: ({computePass, getBuffer}) => {
|
|
771
|
-
const bindings: Record<string, Binding> = {};
|
|
772
|
-
for (const [name, view] of Object.entries(props.bindings)) {
|
|
773
|
-
bindings[name] = getViewBinding(view, getBuffer);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
if (props.dispatchSize) {
|
|
777
|
-
kernel.dispatch(computePass, {
|
|
778
|
-
bindings,
|
|
779
|
-
x: props.dispatchSize.x,
|
|
780
|
-
y: props.dispatchSize.y,
|
|
781
|
-
z: props.dispatchSize.z
|
|
782
|
-
});
|
|
783
|
-
} else {
|
|
784
|
-
kernel.dispatch(computePass, {bindings, x: props.dispatchCount!});
|
|
785
|
-
}
|
|
786
|
-
},
|
|
787
|
-
destroy: () => kernel.destroy()
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
})
|
|
791
|
-
);
|
|
792
773
|
|
|
793
|
-
|
|
774
|
+
kernel.dispatch(computePass, {bindings, x, y, z});
|
|
775
|
+
},
|
|
776
|
+
destroy: () => kernel.destroy()
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
return [setGPUComputeDispatchWorkgroups(node, [x, y, z])];
|
|
794
782
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {setGPUComputeDispatchWorkgroups} from './gpu-command-dispatch-metadata';
|
|
5
6
|
import {type GPUCommandNode, createGPUComputeCommandNode} from './gpu-command-node';
|
|
6
7
|
import {type Binding, type Device} from '@luma.gl/core';
|
|
7
8
|
import {Kernel} from '../execution/compute/kernel';
|
|
@@ -701,50 +702,39 @@ function addKernelPass<Parameters>(
|
|
|
701
702
|
dispatchLayout?: GPUBoundedDispatchLayout;
|
|
702
703
|
}
|
|
703
704
|
): readonly GPUCommandNode<Parameters>[] {
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
705
|
+
const {x, y, z} = props.dispatchLayout ?? {x: props.dispatchCount ?? 1, y: 1, z: 1};
|
|
706
|
+
const node = createGPUComputeCommandNode<Parameters>({
|
|
707
|
+
id: props.id,
|
|
708
|
+
resources: props.resources,
|
|
709
|
+
compile: ({device}) => {
|
|
710
|
+
const bindingNames = Object.keys(props.bindings);
|
|
711
|
+
const kernel = new Kernel(device, {
|
|
712
|
+
id: props.id,
|
|
713
|
+
source: props.source,
|
|
714
|
+
shaderLayout: {
|
|
715
|
+
bindings: bindingNames.map((name, location) => ({
|
|
716
|
+
name,
|
|
717
|
+
type: 'storage' as const,
|
|
718
|
+
group: 0,
|
|
719
|
+
location
|
|
720
|
+
}))
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
return {
|
|
724
|
+
encode: ({computePass, getBuffer}) => {
|
|
725
|
+
const bindings: Record<string, Binding> = {};
|
|
726
|
+
for (const [name, view] of Object.entries(props.bindings)) {
|
|
727
|
+
bindings[name] = getViewBinding(view, getBuffer);
|
|
721
728
|
}
|
|
722
|
-
});
|
|
723
|
-
return {
|
|
724
|
-
encode: ({computePass, getBuffer}) => {
|
|
725
|
-
const bindings: Record<string, Binding> = {};
|
|
726
|
-
for (const [name, view] of Object.entries(props.bindings)) {
|
|
727
|
-
bindings[name] = getViewBinding(view, getBuffer);
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
if (props.dispatchLayout) {
|
|
731
|
-
kernel.dispatch(computePass, {
|
|
732
|
-
bindings,
|
|
733
|
-
x: props.dispatchLayout.x,
|
|
734
|
-
y: props.dispatchLayout.y,
|
|
735
|
-
z: props.dispatchLayout.z
|
|
736
|
-
});
|
|
737
|
-
} else {
|
|
738
|
-
kernel.dispatch(computePass, {bindings, x: props.dispatchCount ?? 1});
|
|
739
|
-
}
|
|
740
|
-
},
|
|
741
|
-
destroy: () => kernel.destroy()
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
})
|
|
745
|
-
);
|
|
746
729
|
|
|
747
|
-
|
|
730
|
+
kernel.dispatch(computePass, {bindings, x, y, z});
|
|
731
|
+
},
|
|
732
|
+
destroy: () => kernel.destroy()
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
return [setGPUComputeDispatchWorkgroups(node, [x, y, z])];
|
|
748
738
|
}
|
|
749
739
|
|
|
750
740
|
/** Returns the WGSL scalar type corresponding to a supported GPU storage format. */
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {assert} from '@luma.gl/core';
|
|
6
|
+
import {gpuGraph, type GPUGraphVector} from './gpu-graph-value';
|
|
7
|
+
import type {GPUOperation} from './gpu-operation';
|
|
8
|
+
import {getGPUOperationValueName, type GPUOperationContract} from './gpu-operation-contract';
|
|
9
|
+
import type {GPUGroupAggregationOperation} from './gpu-group-aggregation';
|
|
10
|
+
import type {GPUReductionOperation} from './gpu-reduction';
|
|
11
|
+
|
|
12
|
+
type ScalarFormat = 'uint32' | 'sint32' | 'float32';
|
|
13
|
+
|
|
14
|
+
/** Logical inputs and destination for dense grouped statistics. */
|
|
15
|
+
export type GPUGraphGroupAggregationProps = {
|
|
16
|
+
/** Stable operation identifier. Defaults to the output name plus a suffix. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** Dense unsigned group keys; out-of-range keys are ignored. */
|
|
19
|
+
keys: string | GPUGraphVector<'uint32'>;
|
|
20
|
+
/** Optional row selection: zero rejects, nonzero accepts. */
|
|
21
|
+
mask?: string | GPUGraphVector<'uint32'>;
|
|
22
|
+
/** Output cardinality. May be omitted when output storage/shape is declared separately. */
|
|
23
|
+
groupCount?: number;
|
|
24
|
+
} & (
|
|
25
|
+
| {
|
|
26
|
+
/** Count accepted rows per group. */
|
|
27
|
+
operation: 'count';
|
|
28
|
+
/** Logical unsigned count destination. */
|
|
29
|
+
output: string | GPUGraphVector<'uint32'>;
|
|
30
|
+
values?: never;
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
/** Statistic computed over finite float32 contributions. */
|
|
34
|
+
operation: Exclude<GPUGroupAggregationOperation, 'count'>;
|
|
35
|
+
/** One float32 contribution per key. */
|
|
36
|
+
values: string | GPUGraphVector<'float32'>;
|
|
37
|
+
/** Logical float32 statistic destination. */
|
|
38
|
+
output: string | GPUGraphVector<'float32'>;
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
/** Dense grouped statistics lowered to GPUGroupAggregation by GPUGraphCompiler. */
|
|
43
|
+
export class GPUGraphGroupAggregation implements GPUOperation {
|
|
44
|
+
/** Semantic operation discriminator. */
|
|
45
|
+
readonly type = 'group-aggregation';
|
|
46
|
+
/** Stable operation identifier. */
|
|
47
|
+
readonly id: string;
|
|
48
|
+
/** Immutable logical operation arguments. */
|
|
49
|
+
readonly props: Readonly<GPUGraphGroupAggregationProps>;
|
|
50
|
+
|
|
51
|
+
/** Describe grouped reduction without allocating or reading GPU storage. */
|
|
52
|
+
constructor(props: GPUGraphGroupAggregationProps) {
|
|
53
|
+
// Dense group destinations must have positive integer cardinality.
|
|
54
|
+
assert(
|
|
55
|
+
props.groupCount === undefined ||
|
|
56
|
+
(Number.isSafeInteger(props.groupCount) && props.groupCount > 0)
|
|
57
|
+
);
|
|
58
|
+
this.id = props.id ?? `${getGPUOperationValueName(props.output)}-group-aggregation`;
|
|
59
|
+
this.props = Object.freeze({...props});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Logical dependencies and optional inferred output shape. */
|
|
63
|
+
get contract(): GPUOperationContract {
|
|
64
|
+
const {keys, mask, output, groupCount} = this.props;
|
|
65
|
+
const values = this.props.operation === 'count' ? undefined : this.props.values;
|
|
66
|
+
return {
|
|
67
|
+
outputs: ({getValue}) => {
|
|
68
|
+
for (const input of [keys, mask]) {
|
|
69
|
+
if (input) {
|
|
70
|
+
const descriptor = getValue(getGPUOperationValueName(input));
|
|
71
|
+
assert(descriptor.type === 'vector' && descriptor.format === 'uint32');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (values) {
|
|
75
|
+
const descriptor = getValue(getGPUOperationValueName(values));
|
|
76
|
+
assert(descriptor.type === 'vector' && descriptor.format === 'float32');
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
[getGPUOperationValueName(output)]: gpuGraph.vector(
|
|
80
|
+
this.props.operation === 'count' ? 'uint32' : 'float32',
|
|
81
|
+
{length: groupCount}
|
|
82
|
+
)
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
values: [
|
|
86
|
+
{value: keys, access: 'read'},
|
|
87
|
+
...(values ? [{value: values, access: 'read' as const}] : []),
|
|
88
|
+
...(mask ? [{value: mask, access: 'read' as const}] : []),
|
|
89
|
+
{value: output, access: 'write'}
|
|
90
|
+
]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Logical scalar reduction inputs and destination. */
|
|
96
|
+
export type GPUGraphReductionProps = {
|
|
97
|
+
/** Stable operation identifier. Defaults to the output name plus a suffix. */
|
|
98
|
+
id?: string;
|
|
99
|
+
/** Scalar uint32, sint32, or float32 input. */
|
|
100
|
+
input: string | GPUGraphVector<ScalarFormat>;
|
|
101
|
+
/** Optional nonzero/zero row selection. */
|
|
102
|
+
mask?: string | GPUGraphVector<'uint32'>;
|
|
103
|
+
/** Statistic to compute; extent produces minimum followed by maximum. */
|
|
104
|
+
operation: GPUReductionOperation;
|
|
105
|
+
/** Logical result destination, with the same format as input. */
|
|
106
|
+
output: string | GPUGraphVector<ScalarFormat>;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** Scalar statistics lowered to GPUReduction by GPUGraphCompiler. */
|
|
110
|
+
export class GPUGraphReduction implements GPUOperation {
|
|
111
|
+
/** Semantic operation discriminator. */
|
|
112
|
+
readonly type = 'reduction';
|
|
113
|
+
/** Stable operation identifier. */
|
|
114
|
+
readonly id: string;
|
|
115
|
+
/** Immutable logical operation arguments. */
|
|
116
|
+
readonly props: Readonly<GPUGraphReductionProps>;
|
|
117
|
+
|
|
118
|
+
/** Describe a scalar reduction without allocating or reading GPU storage. */
|
|
119
|
+
constructor(props: GPUGraphReductionProps) {
|
|
120
|
+
this.id = props.id ?? `${getGPUOperationValueName(props.output)}-reduction`;
|
|
121
|
+
this.props = Object.freeze({...props});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Infer a packed one-row result, or two rows for extent. */
|
|
125
|
+
get contract(): GPUOperationContract {
|
|
126
|
+
const {input, mask, output, operation} = this.props;
|
|
127
|
+
return {
|
|
128
|
+
outputs: ({getValue}) => {
|
|
129
|
+
const descriptor = getValue(getGPUOperationValueName(input));
|
|
130
|
+
assert(descriptor.type === 'vector');
|
|
131
|
+
const {format} = descriptor;
|
|
132
|
+
assert(format === 'uint32' || format === 'sint32' || format === 'float32');
|
|
133
|
+
if (mask) {
|
|
134
|
+
const selection = getValue(getGPUOperationValueName(mask));
|
|
135
|
+
assert(selection.type === 'vector' && selection.format === 'uint32');
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
[getGPUOperationValueName(output)]: gpuGraph.vector(format, {
|
|
139
|
+
length: operation === 'extent' ? 2 : 1
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
values: [
|
|
144
|
+
{value: input, access: 'read'},
|
|
145
|
+
...(mask ? [{value: mask, access: 'read' as const}] : []),
|
|
146
|
+
{value: output, access: 'write'}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
package/src/gpu-core/index.ts
CHANGED
|
@@ -702,3 +702,9 @@ export type {
|
|
|
702
702
|
GPUCPUVector,
|
|
703
703
|
GPUCPUResult
|
|
704
704
|
} from './gpu-cpu-operation';
|
|
705
|
+
|
|
706
|
+
export {GPUGraphGroupAggregation, GPUGraphReduction} from './gpu-semantic-aggregation-operation';
|
|
707
|
+
export type {
|
|
708
|
+
GPUGraphGroupAggregationProps,
|
|
709
|
+
GPUGraphReductionProps
|
|
710
|
+
} from './gpu-semantic-aggregation-operation';
|
|
@@ -6,6 +6,7 @@ import {assert, Buffer, type Device, type BufferProps} from '@luma.gl/core';
|
|
|
6
6
|
import {CPUData} from './cpu-data';
|
|
7
7
|
import {CPUVector} from './cpu-vector';
|
|
8
8
|
import {GPUData} from './gpu-data';
|
|
9
|
+
import {getGPUDataBufferProps, PORTABLE_GPU_DATA_USAGE} from './gpu-data-buffer-props';
|
|
9
10
|
import {GPUVector} from './gpu-vector';
|
|
10
11
|
import {getGPUVectorFormatInfo, type GPUVectorFormat} from './gpu-vector-format';
|
|
11
12
|
|
|
@@ -30,6 +31,13 @@ export function makeGPUVectorFromCPUVector<T extends GPUVectorFormat>(
|
|
|
30
31
|
assert(
|
|
31
32
|
inferredIndexType && (!options.indexType || options.indexType === inferredIndexType)
|
|
32
33
|
);
|
|
34
|
+
const defaults =
|
|
35
|
+
options.usage === undefined
|
|
36
|
+
? getGPUDataBufferProps(device, inferredIndexType)
|
|
37
|
+
: {
|
|
38
|
+
usage: PORTABLE_GPU_DATA_USAGE,
|
|
39
|
+
indexType: undefined
|
|
40
|
+
};
|
|
33
41
|
const count = info.vertexList || info.valueList ? chunk.valueLength : chunk.length;
|
|
34
42
|
const bytes = new Uint8Array(count * info.byteLength);
|
|
35
43
|
for (let index = 0; index < count; index++)
|
|
@@ -45,15 +53,10 @@ export function makeGPUVectorFromCPUVector<T extends GPUVectorFormat>(
|
|
|
45
53
|
new GPUData({
|
|
46
54
|
buffer: device.createBuffer({
|
|
47
55
|
data: bytes.length ? bytes : new Uint8Array(4),
|
|
48
|
-
usage:
|
|
49
|
-
Buffer.COPY_SRC |
|
|
50
|
-
Buffer.COPY_DST |
|
|
51
|
-
Buffer.STORAGE |
|
|
52
|
-
Buffer.VERTEX |
|
|
53
|
-
(options.usage ?? 0),
|
|
56
|
+
usage: (defaults.usage ?? 0) | (options.usage ?? 0),
|
|
54
57
|
indexType:
|
|
55
58
|
options.indexType ??
|
|
56
|
-
((options.usage ?? 0) & Buffer.INDEX ? inferredIndexType :
|
|
59
|
+
((options.usage ?? 0) & Buffer.INDEX ? inferredIndexType : defaults.indexType)
|
|
57
60
|
}),
|
|
58
61
|
format: vector.format,
|
|
59
62
|
length: chunk.length,
|