Skip to content

Commit

Permalink
GPU Aggregator : enable partial test
Browse files Browse the repository at this point in the history
  • Loading branch information
1chandu committed May 29, 2019
1 parent 62d93cb commit 5f6ab39
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Expand Up @@ -1031,7 +1031,10 @@ export default class GPUGridAggregator {
}
const vertexCount = positions.length / 2;
positionsBuffer = new Buffer(gl, new Float32Array(positions));
positions64xyLowBuffer = new Buffer(gl, {size: 2, data: new Float32Array(positions64xyLow)});
positions64xyLowBuffer = new Buffer(gl, {
data: new Float32Array(positions64xyLow),
accessor: {size: 2}
});
this.setState({positionsBuffer, positions64xyLowBuffer, vertexCount});

this.setupWeightAttributes(opts);
Expand Down
Expand Up @@ -47,7 +47,7 @@ test('GridAggregationUtils#pointToDensityGridData (CPU vs GPU)', t => {
aggregationFlags: {dataChanged: true},
fp64: true // NOTE this test fails wihtout FP64 gpu aggregation.
};
const CELLSIZES = [5, 10, 15, 25, 50, 100, 200, 500, 1000, 5000];
const CELLSIZES = [25, 50, 100, 200, 500, 1000, 5000];
for (const cellSizeMeters of CELLSIZES) {
opts.cellSizeMeters = cellSizeMeters;
opts.gpuAggregation = false;
Expand All @@ -57,14 +57,12 @@ test('GridAggregationUtils#pointToDensityGridData (CPU vs GPU)', t => {

const cpuCountsData = cpuResults.weights.weight.aggregationBuffer.getData();
const gpuCountsData = gpuResults.weights.weight.aggregationBuffer.getData();
if (cellSizeMeters >= 100) {
// takes too long to compare for smaller cell sizes
t.deepEqual(
cpuCountsData,
gpuCountsData,
`Cell aggregation data should match for cellSizeMeters:${cellSizeMeters}`
);
}

t.deepEqual(
cpuCountsData,
gpuCountsData,
`Cell aggregation data should match for cellSizeMeters:${cellSizeMeters}`
);

const cpuMaxCountsData = cpuResults.weights.weight.maxBuffer.getData();
const gpuMaxCountData = gpuResults.weights.weight.maxBuffer.getData();
Expand All @@ -73,11 +71,13 @@ test('GridAggregationUtils#pointToDensityGridData (CPU vs GPU)', t => {
gpuMaxCountData[0],
`Max data should match for cellSizeMeters:${cellSizeMeters}`
);
t.deepEqual(
cpuMaxCountsData[3],
gpuMaxCountData[3],
`Total count should match for cellSizeMeters:${cellSizeMeters}`
);
// TODO - This is failing in headless browser test. Might be related to
// https://github.com/uber/luma.gl/issues/1127
// t.deepEqual(
// cpuMaxCountsData[3],
// gpuMaxCountData[3],
// `Total count should match for cellSizeMeters:${cellSizeMeters}`
// );
}

t.end();
Expand Down
4 changes: 1 addition & 3 deletions test/modules/index.js
Expand Up @@ -32,8 +32,6 @@ if (typeof document !== 'undefined') {
require('./react');
require('./main/bundle');
require('./aggregation-layers/utils/gpu-grid-aggregator.spec');
// TODO - This is failing in headless browser test. Might be related to
// https://github.com/uber/luma.gl/issues/906
// require('./aggregation-layers/utils/grid-aggregation-utils.spec');
require('./aggregation-layers/utils/grid-aggregation-utils.spec');
require('./core/lib/pick-layers.spec');
}

0 comments on commit 5f6ab39

Please sign in to comment.