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

📄 big.br

📁 用于GPU通用计算的编程语言BrookGPU 0.4
💻 BR
字号:
// big.br// tests big streams with address-translation#include <stdio.h>kernel void copy( float a[][][][], out float b<> ) {        float4 index = {(indexof b).x,0,0,0};	b = a[index];}int main( int argc, char** argv ) {	int SIZE = atoi( argv[1] );	int i, j;		float a< 1, 1, 1, SIZE >;	float b< SIZE >;	float* a_data;	float* b_data;		a_data = (float*)malloc( SIZE*sizeof(float) );	b_data = (float*)malloc( SIZE*sizeof(float) );	for( i = 0; i < SIZE; i++ )	{		a_data[i] = (float)i;	}	streamRead( a, a_data );	copy( a, b );	streamWrite( b, b_data );	for( i = 0; i < SIZE; i++ )	{		j = i;		if( b_data[i] != j )			printf( "[%d] %f != %d\n", i, b_data[i], j );	}	printf( "done\n" );	return 0;}

⌨️ 快捷键说明

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