GPU Based GMxBs Modeling Program



Excelbooster VBA1. Supporting VBA GrammarExcelbooster will convert VBA codes to C++ codes and AMP C++ codes which enable parallel computing with any GPU card. However, Excelbooster can’t convert all VBA grammar or functions. Also, there will be rounding error due to the difference in computing method.Excelbooster support file input, output functions with binary format only and support limited character functions.All key words should be started with an uppercase letter followed by lowercase letters. For example, If is allowed while IF, iF, if are not allowed.Only English alphabets and “_” can be used for variables, functions, worksheets, ranges name. Also, name can’t be started with numeric number. Excelbooster converts name as it is without any modification; therefore, all names should follow C++ instruction.1.1 DeclareAll VBA codes start with “Option Explicit”; otherwise, Excelbooster stops converting.Variant, Object type can’t be used. Excelbooster supports only following types: Integer, Double, Single, Long, Short, fixed number StringReserve words for Parsing: "Attribute", "Access", "And", "As", "Boolean", "Call", "Case", "Cells", "ClearContents", "Close", "Const", "Dim", "Double", "Else", "ElseIf", "End", "Erase", "Exit", "Explicit", "False", "For", "Function", "Get", "If", "Integer", "Long", "Mod", "Next", "Not", "Option", "Or", "Private", "Public", "Range", "ReDim", "Select", "Sheets", "Short", "Single", "Step", "Sub", "Then", "True", "Type", "To", "Value", "With", "Worksheets"Wrong Declaration: Dim A, B, C As DoubleCorrect Declaration: Dim A As Double, B As Double, C As DoubleCorrect Type Declaration: Type variable can’t be used inside Type declaration and should be declared one variable at each line.Public Type Vtb_Table_D Vtb_Code1 As Double Vtb_Code2 As Double Ystr_Rsfn(0 To 99) As Double Yend_Rsfn(0 To 99) As DoubleEnd TypePrivate, Public, Constant, Array DeclarationPrivate Product_Fund_Cnt As IntegerPublic Const Market_Return_Cnt As Integer = 6, Scn_Rec As Integer = 1000Private GPrem(0 To Max_End_Age) As SinglePublic Lapse_Rate(1 To 12) As DoubleWrong Declaration: Variable or numerical formula can’t be used to declare Array size.Private GPrem(Max_End_Age-1) As SingleStarting number for Array is 0 or 1. 1 is default number.1.2 Sub and FunctionDeclare SubPublic Sub Get_Scenarios()...End SubInside SubExit Sub: To end Sub routineDim TotRec As SingleRedim can’t be usedUse Call to call Sub routine to avoid conflicts with Array nameCall Get_Scenarios1.3 Assignment OperatorVtb2_Ystr_Rsfn(j) = Vtb_Table_Data(i).Ystr_Rsfn(j)a = 3 : b = 4 : c = 51.4 With Excelbooster does not support Object; therefore “With” can be used with “Type” structure variablesWith AAA .BB = 3 ' same as AAA.BB = 3 With BBB .CC = 5 ' same as = 5 .BB = 6 ' same as BBB.BB = 6 End With .DD = 7 ' same as AAA.DD = 7End With1.5 If, Then, Else and Arithmetic OperatorIf … Then ElseEnd IfIf … Then … ElseSelect Case Product_CodeCase 1 To 3Case 4 To 7Case ElseEnd SelectExcelbooster does not support For Next Step Exit For (For Each )Arithmetic Operator+, -, *, /, \, ^, Mod, (, )<, >, >=, <=, <>And, Or, Not- ^ operator will convert to pow() functionA^2 pow(A, 2)1.6 Basic Mathematics FunctionExp , Log , Sin, Cos, Tan1.7 “_” for long line Codinga = 3 + _5Same as “a = 3 + 5”1.8 dividerVBA computes 1 / 10 as 0.1; however, C++ computes 1/ 10 as 0Therefore, Excelbooster convert 1 / 10 same way as VBA and computes as 0.1.1 / 10 (double) 1 / 101 \ 10 (integer) 1 / 101# / 10# (double) 1 / 101.9 Does not SupportBoolean a = (b=c) ByRef Compare string: will provide LibraryAll mathematics functions unless mentioned in this manual2. Psuedo CodesStart with two single quotation mark''IGN{''IGN} to ignore all codes between ''IGN{ and ''IGN}''START to indicate starting point''FMP:FOR(Scenario, 1, 1000) for parallel computing- Coding Sample for Parallel ComputingDim Scenario as LongDim Result(1000) as Double''FMP:FOR(Scenario, 1, 1000)For Scenario = 1 to 1000Dim Var1 As DoubleVar1 = 0#Var1 = Var1 + ScenarioResult(Scenario) = Var1 * 2Next ScenarioVariable Scenario and Array Result(1000) should be declared outside of For Loop.Array Result(1000) and variable Var1 will be used at each GPU core simultaneously. For example, GPU core 1 use Result(1) and Var1 while GPU core 5 use Result(5) and Var1 to execute For Loop simultaneously and store the result to Result(1) and Result(5) separately 3. Header File and C++ Codes FileExcelbooster will generate fortress.h and converted C++ codes file. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download