Skip to content

Commit

Permalink
OpenGL range_for support (stage 2.1.1) (#594)
Browse files Browse the repository at this point in the history
* [skip ci] range for using GLSL threads

range for and extptr (TODO: extptr not work)

[skip ci] remove ext ptr fake support

 Conflicts:
	examples/opengl_backend.py
	taichi/codegen/codegen_opengl.cpp
	taichi/platform/opengl/opengl_kernel.cpp
	taichi/platform/opengl/opengl_kernel.h

 Conflicts:
	taichi/program/program.cpp

* [skip ci] fix typo in _thread_id_ > (should be >=)

 Conflicts:
	taichi/codegen/codegen_opengl.cpp

 Conflicts:
	taichi/codegen/codegen_opengl.cpp

* multi work groups & compile before launch to save time

 Conflicts:
	taichi/codegen/codegen_opengl.cpp
	taichi/platform/opengl/opengl_api.cpp
	taichi/platform/opengl/opengl_api.h
	taichi/platform/opengl/opengl_data_types.h

fix merge

 Conflicts:
	taichi/codegen/codegen_opengl.cpp

* [skip ci] non-GL build fix
  • Loading branch information
archibate authored Mar 14, 2020
1 parent b6c6c1e commit ee4090d
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 77 deletions.
14 changes: 14 additions & 0 deletions examples/opengl_range_for.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import taichi as ti

ti.init(arch=ti.opengl)

x = ti.var(ti.i32, shape=(5, 5))

@ti.kernel
def func():
for i in range(5):
for j in range(5):
x[i, j] = i + j

func()
print(x[2, 3])
Loading

0 comments on commit ee4090d

Please sign in to comment.