⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexof_output.br

📁 用于GPU通用计算的编程语言BrookGPU 0.4
💻 BR
字号:
// indexof.br// Tests the built-in operator 'indexof.'// It confirms the invariant that when// a stream is passed as both a stream// argument and a gather argument to// a kernel, fetching from the gather// argument with the index of the stream// argument should produce the same// value as the stream argument.#include <stdio.h>extern void printf();extern void streamRead();extern void streamWrite();kernel void foo (out float e<>) {      e = (indexof(e)).x+(indexof(e)).y*10;}int main () {  float e<10, 10>;    float data_e[10][10];  int i,j;  foo(e);  streamWrite(e, data_e);    for (i=0; i<10; i++) {    for (j=0; j<10; j++) {      printf ("%3.2f ", (float)(int)data_e[i][j]);    }    printf ("\n");  }  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -