You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.
Hi, perhaps it's me not understanding how to use turbo.js, but I have the following test program, which produces an array of size 256, whereas I would expect it to produce an array of size 16 by reading (perhaps in a wrong way) the docs. Indeed that's because in "alloc" there is a line reading "data: new Float32Array(ns * 16)", and the values of sz and ns are the same when sz is a power of two. Could you clarify or maybe this is actually a bug?
let k = 16
var input = turbojs.alloc(k)
var t0 = window.performance.now()
for (let i = 0; i < k; i++) input.data[i] = i
var t1 = window.performance.now()
console.log(t1 - t0)
t0 = window.performance.now()
turbojs.run(input, `
void main(void) {
commit(read());
}
`)
t1 = window.performance.now()
console.log(t1 - t0)
}
console.log(input.data)
The text was updated successfully, but these errors were encountered:
Update: if you replace your "1.386" constant in alloc with "log(4)" then allocation fails with an error, that's because "ns" gets assigned a different result if you use log(4) instead of 1.386 when sz is 16 (try just that in chrome's javascript console!). Why do you need a power of 4-sized texture anyway?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, perhaps it's me not understanding how to use turbo.js, but I have the following test program, which produces an array of size 256, whereas I would expect it to produce an array of size 16 by reading (perhaps in a wrong way) the docs. Indeed that's because in "alloc" there is a line reading "data: new Float32Array(ns * 16)", and the values of sz and ns are the same when sz is a power of two. Could you clarify or maybe this is actually a bug?
The text was updated successfully, but these errors were encountered: