Published
Edited
Apr 7, 2020
Insert cell
md`# GPU.js Returning a Constant of Array(2)`
Insert cell
{
const gpu = new GPU();
const kernel = gpu.createKernel(function() {
return this.constants.value;
}, {
output: [1],
constants: {
value: [1, 2]
},
constantTypes: { value: 'Array(2)' }
});
return kernel();
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more