Tianqi Chen, a senior fellow student from ACM Class of Shanghai Jiao Tong University (now at UW) published TVM, which introduced the first WebGL-based deep learning… This is fully possible given existing neural network code on ShaderToy… But still, real-time deep learning at the browser side is clever, and ambitious… and they did it! …
The Web Version of My AI Chatbot – LJAI
LJAI is a personal chatbot hosted in my private server, available on the WeChat platform by searching 爱打滚的玲酱, and now available via the Web platform! What makes LJAI different is the virtual and real mapping of our own cat. Recently, we have acquired over 120 users, and thousands of chat messages. http://veritayuan.com/lingjiang Compared with the…
Exploration of the IEEE-754 Floating Point Standard
IEEE-754 Question: Execute the following while loops (modifying the code to add a counter). Explain the reasons these loops for the observed count value.
1 2 3 4 |
c = zeros(3,1); x = 1; while 1 + x > 1, x = x / 2, c(1) = c(1) + 1, end %53 x = 1; while x + x > x, x = 2 * x, c(2) = c(2) + 1, end %1024 x = 1; while x + x > x, x = x / 2, c(3) = c(3) + 1, end %1075 |
Solution The counter is 53, 1024, 1075 for the above three for loops. The code is attatched in 4.2. According to IEEE-754 (double precision), the machine epsilon is $2^{-52}$….
My CUDA Helper for Visual Studio
My CUDA Helper for Visual Studio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
#pragma once #pragma comment(lib, "cudart.lib") #if _DEBUG #pragma comment(lib, "opencv_world330d.lib") #else #pragma comment(lib, "opencv_world330.lib") #endif #ifdef __CUDACC__ #define KERNEL_ARG2(grid, block) <<< grid, block >>> #define KERNEL_ARG3(grid, block, sh_mem) <<< grid, block, sh_mem >>> #define KERNEL_ARG4(grid, block, sh_mem, stream) <<< grid, block, sh_mem, stream >>> #else #define KERNEL_ARG2(grid, block) #define KERNEL_ARG3(grid, block, sh_mem) #define KERNEL_ARG4(grid, block, sh_mem, stream) #endif #ifdef __INTELLISENSE__ int __float_as_int(float in); float __int_as_float(int in); short __float2half_rn(float in); //Compare-and-Swap operation. unsigned int atomicInc(unsigned int* address, unsigned int val); int atomicCAS(int* address, int compare, int val); unsigned int atomicCAS(unsigned int* address, unsigned int compare, unsigned int val); unsigned long long int atomicCAS(unsigned long long int* address, unsigned long long int compare, unsigned long long int val); int atomicAdd(int* address, int val); unsigned int atomicAdd(unsigned int* address, unsigned int val); unsigned long long int atomicAdd(unsigned long long int* address, unsigned long long int val); float atomicAdd(float* address, float val); double atomicAdd(double* address, double val); int atomicSub(int* address, int val); unsigned int atomicSub(unsigned int* address, unsigned int val); template<class T> T tex2DLayered(cudaTextureObject_t texObj, float x, float y, int layer); template<class T> T tex2DLayered(cudaTextureObject_t texObj, int x, int y, int layer); template<class T> T tex2DLayered(texture<unsigned short, cudaTextureType2DLayered, cudaReadModeElementType> texObj, int x, int y, int layer); template<class T> T surf2DLayeredread(cudaSurfaceObject_t surfObj, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap); template<class T> void surf2DLayeredread(T data, cudaSurfaceObject_t surfObj, int x, int y, int layer, boundaryMode = cudaBoundaryModeTrap); template<class T> void surf3Dwrite(T data, cudaSurfaceObject_t surfObj, int x, int y, int z, boundaryMode = cudaBoundaryModeTrap); #define __syncthreads() #define __syncthreads_or(a) a template<class T> T tex3D(cudaTextureObject_t texObj, float x, float y, float z); template<class T> T tex3DLod(cudaTextureObject_t texObj, float x, float y, float z, float level); #endif |
Implementing Instagram Filters: Brannan, Earlybird
This series illustrate my shaders on Shadertoy.com, which renders Instagram filters in real time. Brannan Filter Brannan filter emphasizes the grey and green colors, and paints a metallic tint upon the photos. Click the mouse for comparison. I write this shader to stylize your photos in batch on my own ShaderToy renderer 🙂 (To be…
[Solution] Leetcode 719. Find K-th Smallest Pair Distance
Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference between A and B. Input: nums = [1,3,1] k = 1 Output: 0 Explanation: Here are all the pairs: (1,3) -> 2 (1,1) -> 0 (3,1) -> 2 Then the 1st…
Some random summaries on deferred rendering
Here are some random thoughts and summaries on deferred rendering pipeline. Deferred shading is generally faster than forward shading According to Unity3D, As a general rule, Deferred Rendering is likely to be a better choice if our game runs on higher-end hardware and uses a lot of realtime lights, shadows and reflections. Forward Rendering is…
Some issues in VR – A personal note
Vergence-accommodation conflict Vergence movements are closely connected to accommodation of the eye. Under normal conditions, changing the focus of the eyes to look at an object at a different distance will automatically cause vergence and accommodation, sometimes known as the accommodation-convergence reflex. Visual odometry Match moving VR in practice GPU-based rendering (almost) as usual (OpengGL,…
My Chatbot in WeChat Platform
It is nothing related with AR and VR. But in the era of AI, who wouldn’t want to develop a cute chatbot? Feel free to scan the QR code below to follow our cute pet 🙂 Most of the code is based upon Python. I have developed the following functionalities. AIML matching Dictionary Idiom Wikipedia…
PostProcessing: Brightness, Contrast, Hue, Saturation, and Vibrance
Real-time image manipulation is always fascinating. With the power of the modern GPU, it is possible to achieve the postprocessing effects all in a single shader. Remember that in GLSL, matrix are column major. Brightness is a float between [-1, 1], directly adding to the RGB Contrast is a float between [0, 1, ∞], directly…
June 2023 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Clock
World
Random Posts
Share
Slideshow
-
Recent Posts
Twitter
My TweetsRecent Comments
- starea on Estimated Cost of Per Atom Function in Real-time Shaders on the GPU
- Ben Parry on Estimated Cost of Per Atom Function in Real-time Shaders on the GPU
- starea on My Chatbot in WeChat Platform
- starea on Equirectangular Projection, Gnomonic Projection, and Cubemaps
- Monty on Equirectangular Projection, Gnomonic Projection, and Cubemaps
Archives
- September 2021
- May 2018
- April 2018
- March 2018
- November 2017
- October 2017
- August 2017
- July 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- June 2016
- April 2016
- March 2016
- February 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- September 2014
- September 2012
- October 2010
- May 2010
- July 2008
Categories
Meta