-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: #585 check for inaccurate results for very small kernel
fix: #585 add features.isSpeedTacticSupported and tests
- Loading branch information
1 parent
1955ad3
commit 7e62639
Showing
12 changed files
with
159 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const { assert, skip, test, module: describe, only } = require('qunit'); | ||
const { GPU } = require('../../src'); | ||
|
||
describe('issue #585 - inaccurate lookups'); | ||
|
||
function testResize(mode) { | ||
const gpu = new GPU({ mode }); | ||
const kernel = gpu.createKernel(function(value) { | ||
return value[this.thread.x]; | ||
}, { | ||
output: [4], | ||
}); | ||
|
||
const result = kernel([0,1,2,3]); | ||
console.log(result); | ||
assert.equal(Math.round(result[0]), 0); | ||
assert.equal(Math.round(result[1]), 1); | ||
assert.equal(Math.round(result[2]), 2); | ||
assert.equal(Math.round(result[3]), 3); | ||
gpu.destroy(); | ||
} | ||
|
||
test('auto', () => { | ||
testResize(); | ||
}); | ||
|
||
test('gpu', () => { | ||
testResize('gpu'); | ||
}); | ||
|
||
(GPU.isWebGLSupported ? test : skip)('webgl', () => { | ||
testResize('webgl'); | ||
}); | ||
|
||
(GPU.isWebGL2Supported ? test : skip)('webgl2', () => { | ||
testResize('webgl2'); | ||
}); | ||
|
||
(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { | ||
testResize('headlessgl'); | ||
}); | ||
|
||
test('cpu', () => { | ||
testResize('cpu'); | ||
}); |