Comments (2)
Thanks Fabio, yes that makes total sense. I will look into it.
from warp.
Hi Fabio, the issue should now be fixed. The following works in 0.6.1
import numpy as np
import warp as wp
wp.init()
@wp.struct
class TestStruct:
x: int
a: wp.array(dtype=int)
b: wp.array(dtype=int)
@wp.func
def foo(s: TestStruct, idx: int):
s.a[idx] = s.x + idx
@wp.kernel
def test_kernel(s: TestStruct):
tid = wp.tid()
foo(s, tid)
s.b[tid] = s.a[tid]
# create struct
ts = TestStruct()
# set members
ts.x = 1
ts.a = wp.array(
np.zeros(3),
dtype=int,
requires_grad=True,
)
ts.b = wp.zeros(3, dtype=int, requires_grad=True)
wp.launch(test_kernel, dim=3, inputs=[ts])
print(ts.b.numpy())
# returns [1 2 3]
from warp.
Related Issues (20)
- CUDA memory leak when interop with Pytorch HOT 3
- Warp appears to use cuda:0 despite cuda:1 being set as default HOT 3
- Support AOT deployment HOT 4
- Computing second order derivatives! HOT 1
- TypeError in warp.sim.model HOT 1
- `wp.mesh_query_point` throws access violation HOT 1
- any plan on supporting float64 computations? HOT 7
- The same code leads to different results on old and new version of Warp
- Unable to run warp exemple on Windows WLS. HOT 1
- String arguments to a kernel launch HOT 1
- Can the garment simulation be shared? HOT 3
- urdfpy (and its depency networkx) has issues with Python 3.10 and numpy > 1.20
- fileno HOT 4
- Running a warp kernel from Jax JIT-compiled function HOT 8
- Omniverse Mandelbrot example crashes GPU HOT 4
- XPBD: Collision constraints on particles HOT 1
- Cuda Graph: Capturing python code HOT 2
- Enable alternative material models for triangle/tetrahedra mesh HOT 3
- About differentiability across warp and pytorch HOT 3
- Rigid-body contact issue/questions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warp.