@luma.gl/graph 10.0.0-alpha.12 → 10.0.0-alpha.14
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/arrow-colors.cjs +99 -18
- package/dist/arrow/arrow-colors.d.ts +27 -10
- package/dist/arrow/arrow-colors.d.ts.map +1 -1
- package/dist/arrow/arrow-colors.js +107 -24
- package/dist/arrow/arrow-colors.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +1506 -163
- package/dist/dist.min.js +401 -105
- package/dist/gpu-core/gpu-expression-operation.cjs +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.js +1 -1
- package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
- 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/color-conversion.cjs +105 -0
- package/dist/gpu-data/color-conversion.d.ts +30 -0
- package/dist/gpu-data/color-conversion.d.ts.map +1 -0
- package/dist/gpu-data/color-conversion.js +109 -0
- package/dist/gpu-data/color-conversion.js.map +1 -0
- 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 +7 -2
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-data/index.d.ts +2 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +1 -0
- package/dist/gpu-data/index.js.map +1 -1
- 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-simple-graph/index.d.ts +1 -1
- package/dist/gpu-simple-graph/index.d.ts.map +1 -1
- package/dist/gpu-simple-graph/index.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +2 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +3 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
- package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
- 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 +11 -8
- package/src/arrow/arrow-colors.ts +194 -33
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
- package/src/gpu-core/gpu-expression-operation.ts +1 -1
- 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/color-conversion.ts +158 -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-data/index.ts +3 -0
- package/src/gpu-graph/index.ts +9 -0
- package/src/gpu-simple-graph/index.ts +1 -0
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +2 -0
- package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
- package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
- package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
- 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
|
@@ -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';
|
|
@@ -0,0 +1,158 @@
|
|
|
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 {fromHalfFloat} from '@luma.gl/shaders';
|
|
7
|
+
import {CPUData} from './cpu-data';
|
|
8
|
+
import {CPUVector} from './cpu-vector';
|
|
9
|
+
import {getGPUVectorFormatInfo, type GPUVectorFormat} from './gpu-vector-format';
|
|
10
|
+
|
|
11
|
+
export type ColorOutputFormat = 'unorm8x4' | 'float16x4' | 'float32x4';
|
|
12
|
+
export type ColorConversionOptions = {
|
|
13
|
+
/** Default RGBA8; preserve keeps source precision while expanding RGB to RGBA. */
|
|
14
|
+
format?: ColorOutputFormat | 'preserve';
|
|
15
|
+
/** Consumer capabilities; never silently select a lossy fallback. */
|
|
16
|
+
acceptedFormats?: readonly ColorOutputFormat[];
|
|
17
|
+
fallbackFormat?: ColorOutputFormat;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Resolve color storage independently from the device and conversion backend. */
|
|
21
|
+
export function resolveColorOutputFormat(
|
|
22
|
+
sourceFormat: GPUVectorFormat,
|
|
23
|
+
options: ColorConversionOptions = {}
|
|
24
|
+
): ColorOutputFormat {
|
|
25
|
+
const info = getGPUVectorFormatInfo(sourceFormat);
|
|
26
|
+
// Only fixed-width byte/IEEE RGB or RGBA rows have color semantics here.
|
|
27
|
+
assert(
|
|
28
|
+
!info.vertexList &&
|
|
29
|
+
!info.valueList &&
|
|
30
|
+
!info.fixedSizeList &&
|
|
31
|
+
(info.components === 3 || info.components === 4) &&
|
|
32
|
+
['uint8', 'float16', 'float32'].includes(info.signedDataType)
|
|
33
|
+
);
|
|
34
|
+
const preserved =
|
|
35
|
+
info.signedDataType === 'float32'
|
|
36
|
+
? 'float32x4'
|
|
37
|
+
: info.signedDataType === 'float16'
|
|
38
|
+
? 'float16x4'
|
|
39
|
+
: 'unorm8x4';
|
|
40
|
+
let format = options.format === 'preserve' ? preserved : (options.format ?? 'unorm8x4');
|
|
41
|
+
if (options.acceptedFormats && !options.acceptedFormats.includes(format)) {
|
|
42
|
+
if (
|
|
43
|
+
options.format === 'preserve' &&
|
|
44
|
+
options.fallbackFormat &&
|
|
45
|
+
options.acceptedFormats.includes(options.fallbackFormat)
|
|
46
|
+
)
|
|
47
|
+
format = options.fallbackFormat;
|
|
48
|
+
else throw new Error('Requested color format is not accepted by the consumer');
|
|
49
|
+
}
|
|
50
|
+
return format;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** CPU storage interpretation, independent of output format negotiation. */
|
|
54
|
+
type CPUColorConversionOptions = ColorConversionOptions & {
|
|
55
|
+
/** Interpret packed Float16 RGB stored using the uint16x3-webgl alias. */
|
|
56
|
+
inputFormat?: 'float16x3';
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Convert CPU color chunks without uploading or combining chunks. Input storage is borrowed. */
|
|
60
|
+
export function convertCPUColors(
|
|
61
|
+
source: CPUVector,
|
|
62
|
+
options?: CPUColorConversionOptions & {format?: 'unorm8x4'}
|
|
63
|
+
): CPUVector<'unorm8x4'>;
|
|
64
|
+
export function convertCPUColors<T extends ColorOutputFormat>(
|
|
65
|
+
source: CPUVector,
|
|
66
|
+
options: CPUColorConversionOptions & {format: T}
|
|
67
|
+
): CPUVector<T>;
|
|
68
|
+
export function convertCPUColors(
|
|
69
|
+
source: CPUVector,
|
|
70
|
+
options: CPUColorConversionOptions
|
|
71
|
+
): CPUVector<ColorOutputFormat>;
|
|
72
|
+
export function convertCPUColors(
|
|
73
|
+
source: CPUVector,
|
|
74
|
+
options: CPUColorConversionOptions = {}
|
|
75
|
+
): CPUVector<ColorOutputFormat> {
|
|
76
|
+
const format = resolveColorOutputFormat(
|
|
77
|
+
options.inputFormat ? 'float16x4' : source.format,
|
|
78
|
+
options
|
|
79
|
+
);
|
|
80
|
+
if (options.format === 'preserve' && source.format === format)
|
|
81
|
+
return new CPUVector({
|
|
82
|
+
name: source.name,
|
|
83
|
+
format,
|
|
84
|
+
data: source.data as readonly CPUData<ColorOutputFormat>[]
|
|
85
|
+
});
|
|
86
|
+
return new CPUVector({
|
|
87
|
+
name: source.name,
|
|
88
|
+
format,
|
|
89
|
+
data: source.data.map(chunk => convertCPUColorData(chunk, format, options.inputFormat))
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** @internal Shared CPU backend implementation, including offsets, strides and validity. */
|
|
94
|
+
export function convertCPUColorData(
|
|
95
|
+
source: CPUData,
|
|
96
|
+
format: ColorOutputFormat,
|
|
97
|
+
inputFormat?: string
|
|
98
|
+
): CPUData<ColorOutputFormat> {
|
|
99
|
+
const info = getGPUVectorFormatInfo(source.format);
|
|
100
|
+
const type = inputFormat?.startsWith('float16') ? 'float16' : info.signedDataType;
|
|
101
|
+
const components = inputFormat?.endsWith('x3') ? 3 : info.components;
|
|
102
|
+
// Color rows contain only byte channels or IEEE floats and three or four components.
|
|
103
|
+
assert((components === 3 || components === 4) && ['uint8', 'float16', 'float32'].includes(type));
|
|
104
|
+
const bytes = type === 'uint8' ? 1 : type === 'float16' ? 2 : 4;
|
|
105
|
+
const input = new DataView(source.buffer, source.byteOffset);
|
|
106
|
+
const output =
|
|
107
|
+
format === 'unorm8x4'
|
|
108
|
+
? new Uint8Array(source.length * 4)
|
|
109
|
+
: format === 'float16x4'
|
|
110
|
+
? new Uint16Array(source.length * 4)
|
|
111
|
+
: new Float32Array(source.length * 4);
|
|
112
|
+
const scratch = new DataView(new ArrayBuffer(4));
|
|
113
|
+
for (let rowIndex = 0; rowIndex < source.length; rowIndex++) {
|
|
114
|
+
for (let componentIndex = 0; componentIndex < 4; componentIndex++) {
|
|
115
|
+
const offset = rowIndex * source.byteStride + componentIndex * bytes;
|
|
116
|
+
const value =
|
|
117
|
+
componentIndex >= components
|
|
118
|
+
? 1
|
|
119
|
+
: type === 'uint8'
|
|
120
|
+
? input.getUint8(offset) / 255
|
|
121
|
+
: type === 'float16'
|
|
122
|
+
? fromHalfFloat(input.getUint16(offset, true))
|
|
123
|
+
: input.getFloat32(offset, true);
|
|
124
|
+
output[rowIndex * 4 + componentIndex] =
|
|
125
|
+
format === 'unorm8x4'
|
|
126
|
+
? Math.round(Math.min(Math.max(value, 0), 1) * 255)
|
|
127
|
+
: format === 'float16x4'
|
|
128
|
+
? encodeHalfFloat(value, scratch)
|
|
129
|
+
: value;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return new CPUData({
|
|
133
|
+
buffer: output,
|
|
134
|
+
format,
|
|
135
|
+
length: source.length,
|
|
136
|
+
nullBitmap: source.nullBitmap && new Uint8Array(source.nullBitmap)
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** IEEE binary16 round-to-nearest-even, matching pack2x16float (no display-range clamp). */
|
|
141
|
+
function encodeHalfFloat(value: number, scratch: DataView): number {
|
|
142
|
+
scratch.setFloat32(0, value, true);
|
|
143
|
+
const bits = scratch.getUint32(0, true);
|
|
144
|
+
const sign = (bits >>> 16) & 0x8000;
|
|
145
|
+
const exponent = (bits >>> 23) & 255;
|
|
146
|
+
const mantissa = bits & 0x7fffff;
|
|
147
|
+
if (exponent === 255) return sign | 0x7c00 | (mantissa ? 0x200 : 0);
|
|
148
|
+
if (exponent > 142) return sign | 0x7c00;
|
|
149
|
+
if (exponent < 102) return sign;
|
|
150
|
+
const shift = exponent < 113 ? 126 - exponent : 13;
|
|
151
|
+
const significand = exponent < 113 ? mantissa | 0x800000 : mantissa;
|
|
152
|
+
const divisor = 2 ** shift;
|
|
153
|
+
const quotient = Math.floor(significand / divisor);
|
|
154
|
+
const remainder = significand % divisor;
|
|
155
|
+
const rounded =
|
|
156
|
+
quotient + (remainder > divisor / 2 || (remainder === divisor / 2 && quotient % 2) ? 1 : 0);
|
|
157
|
+
return sign | ((exponent < 113 ? 0 : (exponent - 112) * 1024) + rounded);
|
|
158
|
+
}
|
|
@@ -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,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {Buffer, type BufferProps, type Device} from '@luma.gl/core';
|
|
6
|
+
|
|
7
|
+
export const PORTABLE_GPU_DATA_USAGE =
|
|
8
|
+
Buffer.STORAGE | Buffer.VERTEX | Buffer.COPY_SRC | Buffer.COPY_DST;
|
|
9
|
+
|
|
10
|
+
/** Usage defaults for general-purpose GPUData backing storage. */
|
|
11
|
+
export function getGPUDataBufferProps(
|
|
12
|
+
device: Device,
|
|
13
|
+
indexType: BufferProps['indexType'] = 'uint32'
|
|
14
|
+
): Pick<BufferProps, 'usage' | 'indexType'> {
|
|
15
|
+
const usage = PORTABLE_GPU_DATA_USAGE;
|
|
16
|
+
if (device.type !== 'webgpu') {
|
|
17
|
+
// WebGL fixes the buffer target on first bind, so INDEX would prevent vertex use.
|
|
18
|
+
return {usage};
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
usage: usage | Buffer.INDEX | Buffer.UNIFORM | Buffer.INDIRECT | Buffer.QUERY_RESOLVE,
|
|
22
|
+
// Explicit index metadata prevents Device from widening raw Uint8Array uploads.
|
|
23
|
+
indexType
|
|
24
|
+
};
|
|
25
|
+
}
|
package/src/gpu-data/index.ts
CHANGED
|
@@ -73,3 +73,6 @@ export {CPUData, type CPUDataProps} from './cpu-data';
|
|
|
73
73
|
export {CPUVector, type CPUVectorProps} from './cpu-vector';
|
|
74
74
|
|
|
75
75
|
export {makeGPUVectorFromCPUVector, makeCPUVectorFromGPUVector} from './cpu-gpu-vector-transfer';
|
|
76
|
+
|
|
77
|
+
export {convertCPUColors, resolveColorOutputFormat} from './color-conversion';
|
|
78
|
+
export type {ColorOutputFormat, ColorConversionOptions} from './color-conversion';
|