OpenCL
- OpenCL CPU/GPU 변경
- Edit > Preferences > Miscellaneous
- OpenGL Device
- Type : CPU/GPU
- OpenGL Device
- Edit > Preferences > Miscellaneous
https://www.sidefx.com/docs/houdini/vex/ocl.html
VEX | CPU |
OpenCL | CPU / GPU |
OpenCL 자체는 C99를 따름
OpenCL에는 foreach() 없음.
- **OpenCL (Open Computing Language)**은 Khronos Group이 만든 이기종 병렬 컴퓨팅 표준입니다.
- NVIDIA OpenCL은 NVIDIA가 자사의 GPU용으로 만든 OpenCL 구현체입니다.
벡터 로드/저장시 vload/vstore 를 쓰는데 후디니에서는 #bind와 @KERNEL을 활용하여 보다 직관적으로 코딩 가능
- bind
- &: write
- ?: opt
- !: noread
#bind point &P float3
@KERNEL
{
float3 pos = @P;
pos += 1;
@P.set(pos);
}
#bind layer src? val=0
#bind layer !&dst
// The Ultimate Copernicus Guide | Every COP Node Explained - OPENCL
// - https://www.youtube.com/watch?v=ZPL215vfNwg&t=13208s
// ?붙었으니 optional
// !&붙었으니 write / noread
@KERNEL
{
@dst.set(@src);
}
float2 pos; float value = @src.bufferSample(pos);
index x/y/z | @ix, @iy, @iz, @ixy |
resolution x/y | @xres, @yres, @res |
@WRITEBACK
{
@src.set(@dst);
}