-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from gpujs/259-intercept-atan2
fix #259 by handling when atan2 is used directly in the interpreter
- Loading branch information
Showing
9 changed files
with
61 additions
and
8 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
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
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
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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>GPU.JS: createKernelMap with floatOutput</title> | ||
<link rel="stylesheet" href="../../../node_modules/qunitjs/qunit/qunit.css"> | ||
|
||
<!-- gpu.js scripts --> | ||
<script src="../../../bin/gpu.js"></script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="../../../node_modules/qunitjs/qunit/qunit.js"></script> | ||
<script src="../../src/issues/259.js"></script> | ||
</body> | ||
</html> |
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,21 @@ | ||
function buildAtan2KernelResult(mode) { | ||
const gpu = new GPU({ mode }); | ||
const kernel = gpu.createKernel(function() { | ||
return Math.atan2(1, 2); | ||
}, { | ||
output: [1] | ||
}); | ||
return kernel(); | ||
} | ||
|
||
QUnit.test('Issue #259 atan2 - auto', () => { | ||
QUnit.assert.equal(buildAtan2KernelResult()[0].toFixed(7), 0.4636476); | ||
}); | ||
|
||
QUnit.test('Issue #259 atan2 - gpu', () => { | ||
QUnit.assert.equal(buildAtan2KernelResult('gpu')[0].toFixed(7), 0.4636476); | ||
}); | ||
|
||
QUnit.test('Issue #259 atan2 - cpu', () => { | ||
QUnit.assert.equal(buildAtan2KernelResult('cpu')[0].toFixed(7), 0.4636476); | ||
}); |