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.
MATLAB
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
My CUDA Helper for Visual Studio
C
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…
Clock
World
Random Posts
Share
Slideshow
-
Recent Posts
- Wearable Interactions Using Touch without a Touchscreen
- [Talk Summary] HandSight: A Touch-Based Wearable System to Increase Information Accessibility for People with Visual Impairments
- [Talk Summary] A large-scale analysis of YouTube videos depicting everyday thermal camera use
- [Summary] Google I/O and Microsoft Build 2018
- [Summary] StackGAN: Text to Photo-realistic Image Synthesis
Twitter
My TweetsRecent Comments
- CS475 Algorithm Analysis and Design – Course | Ruofei Du on Treap in 45 lines of C++
- MA066 Advanced Algebra I – Course | Ruofei Du on Gradient, Circulation, Laplacian, Divergence, Jacobian, Hessian, and Trace
- Mr Zhu (@834144373zhu) on Tutorial of Ray Casting, Ray Tracing, Path Tracing and Ray Marching
- サンプリングレンダリングの解説記事 – Tech masuk on Tutorial of Ray Casting, Ray Tracing, Path Tracing and Ray Marching
- starea on Estimated Cost of Per Atom Function in Real-time Shaders on the GPU
Archives
- November 2018
- August 2018
- 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