This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef MarchingCubesColorBlobParams_h | |
| #define MarchingCubesColorBlobParams_h | |
| #include <simd/simd.h> | |
| typedef struct { | |
| simd_float3 center; | |
| float radius; | |
| simd_float3 color; | |
| float _pad; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import torch | |
| from typing import Optional, Tuple | |
| # Reference implementation | |
| def sdpa_with_sink(q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, s: torch.Tensor) -> torch.Tensor: | |
| logits = torch.matmul(q, k.transpose(-2, -1)) / (D ** 0.5) # [B, H, S, S] | |
| exp_logits = torch.exp(logits) # [B, H, S, S] | |
| mass = exp_logits.sum(dim=-1, keepdim=True) + s.exp()[:, None, None] # [B, H, S, 1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import cutlass.cute as cute | |
| import cutlass | |
| def visualize_tv_layout( | |
| tiler_mn: tuple[int, int], | |
| tv_layout, # (((thr_shape),(val_shape)), | |
| # ((thr_stride),(val_stride))) | |
| *, | |
| font_size: int = 10, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import partial | |
| import jax | |
| import jax.numpy as jnp | |
| import optax | |
| def poly(x: jnp.ndarray, w: jnp.ndarray): | |
| assert w.shape == (3,) | |
| w = w.astype(jnp.float32) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | |
| // Edits by Glynn Taylor. MIT license | |
| // Includes code for splitmap by https://twitter.com/adamgryu and triplanar mapping by https://github.com/keijiro. MIT License | |
| #ifndef TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED | |
| #define TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED | |
| struct Input | |
| { | |
| float3 localNormal : TEXCOORD0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @Cyanilux | |
| // Note : Also requires setting up "_TessellationUniform" Float in Blackboard | |
| /* | |
| Allows you to inject tessellation into SG & URP, but hacky / can be difficult to work with. | |
| While this works, it's maybe not as useful as you might think. I believe any vertex displacement would need to be | |
| taken out of the graph and moved into the domain function below (since tessellation still runs after vertex shader). | |
| I thought about using the VertexDescriptionFunction from the generated code, but sadly that's generated after the injection point | |
| so can't be called as it's undeclared at that point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First let's update all the packages to the latest ones with the following command | |
| sudo apt update -qq | |
| # Now we want to install some prerequisite packages which will let us use HTTPS over apt | |
| sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq | |
| # After that we will add the GPG key for the official Docker repository to the system | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| # We will add the Docker repository to our APT sources |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import json | |
| predefined_struct = { | |
| "UnityEngine_Vector3_o" : [("float","x"),("float","y"),("float","z")] | |
| } | |
| def extract_class_methods(methods_informations, clazz): | |
| """ | |
| We check if the signature start with the class we want to hook, if so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function bypassCheckProperties() { | |
| /* | |
| * Function used to bypass common checks to | |
| * Android OS properties | |
| * Bypass the props checking from this git : https://github.com/strazzere/anti-emulator | |
| * | |
| */ | |
| const SystemProperties = Java.use('android.os.SystemProperties') | |
| const String = Java.use('java.lang.String') | |
| const Properties = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # tested on AWS p2.xlarge August 29, 2018 | |
| # install CUDA | |
| sudo apt-get update && sudo apt-get install wget -y --no-install-recommends | |
| CUDA_URL="https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64" | |
| wget -c ${CUDA_URL} -O cuda.deb | |
| sudo dpkg --install cuda.deb | |
| sudo apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub | |
| sudo apt-get update | |
| sudo apt-get install -y cuda |
NewerOlder