⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multibolzmatvectorrect.fp

📁 PDE simulator on GPU.
💻 FP
字号:
!!FP1.0
#Date:2003/12/31
#try to compute sparse Matrix - Vector Multiplication Just For TEXRECT
# Vector X  ----TEX0 
# Diagonal Element   ----TEX1 -- AiiRTexID  // record the diagonal elements
# First NonZero Postion--TEX1 -- RTexID;   // record the first non zero & non diagonal element position J
# NonZero NonDiagonal----TEX2 -- AijCTexID; // record the nondiagonal & nonzero elements
# For reference in X ----TEX2 -- CTexID;   // record the according position for Vector X which multiply with Aij
# Previous  ====TEX3 //////record the previous result

#TexPARA.X = PassID;
#TexPARA.Y = NonDiagonal Texture Width;
#TexPARA.Z = 1.0/TexPARA.Y;
#TexPARA.W = 0;
DECLARE TexPARA = {0,0,0,0};

# fetch R[i] from TEX1
TEX R0, f[WPOS], TEX1, RECT;

#Note: AiiRTexID.y = Index Position in 1D
#      AiiRTexID.z = len[i]
#if pass - len >= 0, then kill the current fragment, just return result = prev
#SUBC R1.x, TexPARA.x, R0.z;
#KIL GE.x;

#for the reason of tow pbuffers
SLT R4.x, TexPARA.x, R0.z;

# R0 ---- offset = start + pass -->R0
ADD R0.y, R0.y, TexPARA.x;

# Then to fetch Aj[j+c] from AijTexID(TEX2)
# But firstly we have to convert the 1D tex coord into 2D 
MUL R1.y, R0.y, TexPARA.z;
FLR R1.y, R1.y;
MUL R1.x, R1.y, TexPARA.y;
SUB R1.x, R0.y, R1.x;
FLR R1.x, R1.x;

# Now, we can fetch Aj[j+c] & C[j+c] from Tex2--AijCTexID Texture
TEX R2, R1, TEX2, RECT;

# Then fetch according data from Vector X which in TEX0
# use C[j+c] to fetch X[C[j+c]]
# AijCTexID.yz -- C
TEX R3, R2.yzww, TEX0, RECT;

# fetch previous result
TEX R0, f[WPOS], TEX3, RECT;

# Aj[j+c]*X[C[j+c]] + PreviousResult
#MAD o[COLR], R2, R3, R0;
MUL R2, R2, R3;
MUL R2, R2, R4.xxxx;
ADD o[COLR], R2, R0;

END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -