Skip to content

Commit

Permalink
Bump version to 0.3.0, update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacklin committed Jul 8, 2022
1 parent 5886885 commit 0deca34
Show file tree
Hide file tree
Showing 19 changed files with 627 additions and 230 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# CHANGELOG

## [0.3.0] - 2022-07-08

- Add support for FP16 storage type, see `wp.float16`
- Add support for per-dimension byte strides, see `wp.array.strides`
- Add support for passing Python classes as kernel arguments, see `@wp.struct` decorator
- Add additional bounds checks for builtin matrix types
- Add additional floating point checks, see `wp.config.verify_fp`
- Add interleaved user source with generated code to aid debugging
- Add generalized GPU marching cubes implementation, see `wp.MarchingCubes` class
- Add additional scalar*matrix vector operators
- Add support for retrieving a single row from builtin types, e.g.: `r = m33[i]`
- Add `wp.log2()` and `wp.log10()` builtins
- Add support for quickly instancing `wp.sim.ModelBuilder` objects to improve env. creation performance for RL
- Remove custom CUB version and improve compatability with CUDA 11.7
- Fix to preserve external user-gradients when calling `wp.Tape.zero()`
- Fix to only allocate gradient of a Torch tensor if `requires_grad=True`
- Fix for ray-cast precision in edge case on GPU (watertightness issue)
- Fix for kernel hot-reload when definition changes
- Fix for NVCC warnings on Linux
- Fix for generated function names when kernels are defined as class functions
- Fix for reload of generated CPU kernel code on Linux
- Fix for example scripts to ouput USD at 60 timecodes per-second (better Kit compatability)


## [0.2.3] - 2022-06-13

- Fix for incorrect 4d array bounds checking
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.3
0.3.0
60 changes: 60 additions & 0 deletions docs/_build/html/_sources/modules/functions.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Scalar Types
.. autoclass:: uint32
.. autoclass:: int64
.. autoclass:: uint64
.. autoclass:: float16
.. autoclass:: float32
.. autoclass:: float64
Vector Types
Expand Down Expand Up @@ -154,6 +155,16 @@ Scalar Math
Return the natural log (base-e) of x, where x is positive.


.. function:: log2(x: float32) -> float

Return the natural log (base-2) of x, where x is positive.


.. function:: log10(x: float32) -> float

Return the natural log (base-10) of x, where x is positive.


.. function:: exp(x: float32) -> float

Return base-e exponential, e^x.
Expand Down Expand Up @@ -733,6 +744,36 @@ Utility
Atomically subtract ``value`` onto the array at location given by indices.


.. function:: index(a: vec2, i: int32) -> float


.. function:: index(a: vec3, i: int32) -> float


.. function:: index(a: vec4, i: int32) -> float


.. function:: index(a: quat, i: int32) -> float


.. function:: index(a: mat22, i: int32) -> vec2


.. function:: index(a: mat22, i: int32, j: int32) -> float


.. function:: index(a: mat33, i: int32) -> vec3


.. function:: index(a: mat33, i: int32, j: int32) -> float


.. function:: index(a: mat44, i: int32) -> vec4


.. function:: index(a: mat44, i: int32, j: int32) -> float


.. function:: expect_eq(arg1: int8, arg2: int8) -> None

Prints an error to stdout if arg1 and arg2 are not equal
Expand Down Expand Up @@ -773,6 +814,11 @@ Utility
Prints an error to stdout if arg1 and arg2 are not equal


.. function:: expect_eq(arg1: float16, arg2: float16) -> None

Prints an error to stdout if arg1 and arg2 are not equal


.. function:: expect_eq(arg1: float32, arg2: float32) -> None

Prints an error to stdout if arg1 and arg2 are not equal
Expand Down Expand Up @@ -833,6 +879,11 @@ Utility
Prints an error to stdout if arg1 and arg2 are not equal


.. function:: lerp(a: float16, b: float16, t: float32) -> float16

Linearly interpolate two values a and b using factor t, computed as ``a*(1-t) + b*t``


.. function:: lerp(a: float32, b: float32, t: float32) -> float32

Linearly interpolate two values a and b using factor t, computed as ``a*(1-t) + b*t``
Expand Down Expand Up @@ -1240,6 +1291,15 @@ Operators
.. function:: mul(x: float32, y: quat) -> quat


.. function:: mul(x: float32, y: mat22) -> mat22


.. function:: mul(x: float32, y: mat33) -> mat33


.. function:: mul(x: float32, y: mat44) -> mat44


.. function:: mul(x: vec2, y: float32) -> vec2


Expand Down
52 changes: 30 additions & 22 deletions docs/_build/html/genindex.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@


<div class="version">
0.2.3
0.3.0
</div>


Expand Down
486 changes: 290 additions & 196 deletions docs/_build/html/modules/functions.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_build/html/modules/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@


<div class="version">
0.2.3
0.3.0
</div>


Expand Down
5 changes: 3 additions & 2 deletions docs/_build/html/modules/runtime.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@


<div class="version">
0.2.3
0.3.0
</div>


Expand Down Expand Up @@ -451,7 +451,7 @@ <h3>Multi-dimensional arrays<a class="headerlink" href="#multi-dimensional-array

<dl class="py class">
<dt class="sig sig-object py" id="warp.array">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">warp.</span></span><span class="sig-name descname"><span class="pre">array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shape</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">length</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ptr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">device</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">copy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">owner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ndim</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">requires_grad</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#warp.array" title="Permalink to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">warp.</span></span><span class="sig-name descname"><span class="pre">array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shape</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strides</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">length</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ptr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capacity</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">device</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">copy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">owner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ndim</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">requires_grad</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#warp.array" title="Permalink to this definition"></a></dt>
<dd><p>Constructs a new Warp array object from existing data.</p>
<p>When the <code class="docutils literal notranslate"><span class="pre">data</span></code> argument is a valid list, tuple, or ndarray the array will be constructed from this object’s data.
For objects that are not stored sequentially in memory (e.g.: a list), then the data will first
Expand All @@ -466,6 +466,7 @@ <h3>Multi-dimensional arrays<a class="headerlink" href="#multi-dimensional-array
<li><p><strong>data</strong> (<em>Union</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)"><em>tuple</em></a><em>, </em><em>ndarray</em><em>]</em>) – </p></li>
<li><p><strong>dtype</strong> (<em>Union</em>) – One of the built-in types, e.g.: <a class="reference internal" href="functions.html#id39" title="warp.mat33"><code class="xref py py-class docutils literal notranslate"><span class="pre">warp.mat33</span></code></a>, if dtype is None and data an ndarray then it will be inferred from the array data type</p></li>
<li><p><strong>shape</strong> (<em>Tuple</em>) – Dimensions of the array</p></li>
<li><p><strong>strides</strong> (<em>Tuple</em>) – Number of bytes in each dimension between successive elements of the array</p></li>
<li><p><strong>length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – Number of elements (rows) of the data type (deprecated, users should use <cite>shape</cite> argument)</p></li>
<li><p><strong>ptr</strong> (<a class="reference internal" href="functions.html#warp.uint64" title="warp.uint64"><em>uint64</em></a>) – Address of an external memory address to alias (data should be None)</p></li>
<li><p><strong>capacity</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – Maximum size in bytes of the ptr allocation (data should be None)</p></li>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@


<div class="version">
0.2.3
0.3.0
</div>


Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
copyright = '2022, NVIDIA'
author = 'NVIDIA'

version = '0.2.3'
version = '0.3.0'

# -- General configuration ---------------------------------------------------

Expand Down
60 changes: 60 additions & 0 deletions docs/modules/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Scalar Types
.. autoclass:: uint32
.. autoclass:: int64
.. autoclass:: uint64
.. autoclass:: float16
.. autoclass:: float32
.. autoclass:: float64
Vector Types
Expand Down Expand Up @@ -154,6 +155,16 @@ Scalar Math
Return the natural log (base-e) of x, where x is positive.


.. function:: log2(x: float32) -> float

Return the natural log (base-2) of x, where x is positive.


.. function:: log10(x: float32) -> float

Return the natural log (base-10) of x, where x is positive.


.. function:: exp(x: float32) -> float

Return base-e exponential, e^x.
Expand Down Expand Up @@ -733,6 +744,36 @@ Utility
Atomically subtract ``value`` onto the array at location given by indices.


.. function:: index(a: vec2, i: int32) -> float


.. function:: index(a: vec3, i: int32) -> float


.. function:: index(a: vec4, i: int32) -> float


.. function:: index(a: quat, i: int32) -> float


.. function:: index(a: mat22, i: int32) -> vec2


.. function:: index(a: mat22, i: int32, j: int32) -> float


.. function:: index(a: mat33, i: int32) -> vec3


.. function:: index(a: mat33, i: int32, j: int32) -> float


.. function:: index(a: mat44, i: int32) -> vec4


.. function:: index(a: mat44, i: int32, j: int32) -> float


.. function:: expect_eq(arg1: int8, arg2: int8) -> None

Prints an error to stdout if arg1 and arg2 are not equal
Expand Down Expand Up @@ -773,6 +814,11 @@ Utility
Prints an error to stdout if arg1 and arg2 are not equal


.. function:: expect_eq(arg1: float16, arg2: float16) -> None

Prints an error to stdout if arg1 and arg2 are not equal


.. function:: expect_eq(arg1: float32, arg2: float32) -> None

Prints an error to stdout if arg1 and arg2 are not equal
Expand Down Expand Up @@ -833,6 +879,11 @@ Utility
Prints an error to stdout if arg1 and arg2 are not equal


.. function:: lerp(a: float16, b: float16, t: float32) -> float16

Linearly interpolate two values a and b using factor t, computed as ``a*(1-t) + b*t``


.. function:: lerp(a: float32, b: float32, t: float32) -> float32

Linearly interpolate two values a and b using factor t, computed as ``a*(1-t) + b*t``
Expand Down Expand Up @@ -1240,6 +1291,15 @@ Operators
.. function:: mul(x: float32, y: quat) -> quat


.. function:: mul(x: float32, y: mat22) -> mat22


.. function:: mul(x: float32, y: mat33) -> mat33


.. function:: mul(x: float32, y: mat44) -> mat44


.. function:: mul(x: vec2, y: float32) -> vec2


Expand Down
2 changes: 1 addition & 1 deletion exts/omni.warp/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[package]
# Semantic Versioning is used: https://semver.org/
version = "0.2.3"
version = "0.3.0"
authors = ["Miles Macklin"]
title = "Warp"
description="A Python framework for high-performance simulation and graphics programming"
Expand Down
24 changes: 24 additions & 0 deletions exts/omni.warp/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# CHANGELOG

## [0.3.0] - 2022-07-08

- Add support for FP16 storage type, see `wp.float16`
- Add support for per-dimension byte strides, see `wp.array.strides`
- Add support for passing Python classes as kernel arguments, see `@wp.struct` decorator
- Add additional bounds checks for builtin matrix types
- Add additional floating point checks, see `wp.config.verify_fp`
- Add interleaved user source with generated code to aid debugging
- Add generalized GPU marching cubes implementation, see `wp.MarchingCubes` class
- Add additional scalar*matrix vector operators
- Add support for retrieving a single row from builtin types, e.g.: `r = m33[i]`
- Add `wp.log2()` and `wp.log10()` builtins
- Add support for quickly instancing `wp.sim.ModelBuilder` objects to improve env. creation performance for RL
- Remove custom CUB version and improve compatability with CUDA 11.7
- Fix to preserve external user-gradients when calling `wp.Tape.zero()`
- Fix to only allocate gradient of a Torch tensor if `requires_grad=True`
- Fix for ray-cast precision in edge case on GPU (watertightness issue)
- Fix for kernel hot-reload when definition changes
- Fix for NVCC warnings on Linux
- Fix for generated function names when kernels are defined as class functions
- Fix for reload of generated CPU kernel code on Linux
- Fix for example scripts to ouput USD at 60 timecodes per-second (better Kit compatability)


## [0.2.3] - 2022-06-13

- Fix for incorrect 4d array bounds checking
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="warp-lang",
version="0.2.3",
version="0.3.0",
author="NVIDIA",
author_email="[email protected]",
description="A Python framework for high-performance simulation and graphics programming",
Expand Down
2 changes: 1 addition & 1 deletion warp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import os

version = "0.2.3"
version = "0.3.0"

cuda_path = None # path to local CUDA toolchain, if None at init time warp will attempt to find the SDK using CUDA_PATH env var

Expand Down
7 changes: 7 additions & 0 deletions warp/native/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,13 @@ CUDA_CALLABLE inline T lerp(const T& a, const T& b, float t)
return a*(1.0-t) + b*t;
}

template <>
CUDA_CALLABLE inline float16 lerp(const float16& a, const float16& b, float t)
{
return float(a)*(1.0-t) + float(b)*t;
}


template <typename T>
CUDA_CALLABLE inline void adj_lerp(const T& a, const T& b, float t, T& adj_a, T& adj_b, float& adj_t, const T& adj_ret)
{
Expand Down
Loading

0 comments on commit 0deca34

Please sign in to comment.