Example: biology

Monte-Carlo Simulation on AM57x Using OpenCL …

1 TIDUAR9 September2015 SubmitDocumentationFeedbackCopyright 2015,TexasInstrumentsIncorporatedMonte-C arloSimulationonAM57xUsingOpenCLtoLevera geDSPA ccelerationTI DesignsMonte-CarloSimulationon AM57xUsingOpenCLtoLeverageDSPA ccelerationARM,Cortexare registeredtrademarksof a trademarkof a registeredtrademarkof othertrademarksare the propertyof DesignsTI Designsprovidethe foundationthat you needincludingmethodology,testingand designfiles toquicklyevaluateand customizethe Designshelpyouaccelerateyourtime to E2E ExpertsWEBENCH CalculatorToolsDesignFeatures EnablesUse of the DSPA cceleratorsWithoutRequiringthe Userto HaveExpertKnowledgeofDSP Providesan Exampleof the monte -CarloAlgorithmto GenerateGaussianRandomSequencesThatRun Fasteron the C66xDSPT hanon The ARM Cortex -A15 Core Offersa CompleteSystemReferenceDesignWithExample SoftwareImplementedand TestedUsingthe TI ProcessorSDKand the TI AM57xEVM IncludesSoftwareSource,Schematics.

important notice for ti reference designs

Tags:

  Using, Simulation, Oracl, Monte, Am57x, Opencl, Carlo simulation on am57x using opencl

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Monte-Carlo Simulation on AM57x Using OpenCL …

1 1 TIDUAR9 September2015 SubmitDocumentationFeedbackCopyright 2015,TexasInstrumentsIncorporatedMonte-C arloSimulationonAM57xUsingOpenCLtoLevera geDSPA ccelerationTI DesignsMonte-CarloSimulationon AM57xUsingOpenCLtoLeverageDSPA ccelerationARM,Cortexare registeredtrademarksof a trademarkof a registeredtrademarkof othertrademarksare the propertyof DesignsTI Designsprovidethe foundationthat you needincludingmethodology,testingand designfiles toquicklyevaluateand customizethe Designshelpyouaccelerateyourtime to E2E ExpertsWEBENCH CalculatorToolsDesignFeatures EnablesUse of the DSPA cceleratorsWithoutRequiringthe Userto HaveExpertKnowledgeofDSP Providesan Exampleof the monte -CarloAlgorithmto GenerateGaussianRandomSequencesThatRun Fasteron the C66xDSPT hanon The ARM Cortex -A15 Core Offersa CompleteSystemReferenceDesignWithExample SoftwareImplementedand TestedUsingthe TI ProcessorSDKand the TI AM57xEVM IncludesSoftwareSource,Schematics,Bill ofMaterials.

2 And DesignFiles Applicableto Any ApplicationThatUsesthe BusinessStrategy RadioChannelSimulation PersonalFinance TrafficLoad(RoadCongestion,NetworkCapaci ty,and More)An IMPORTANTNOTICEat the end of this TI referencedesignaddressesauthorizeduse, intellectualpropertymattersand otherimportantdisclaimersand September2015 SubmitDocumentationFeedbackCopyright 2015,TexasInstrumentsIncorporatedMonte-C arloSimulationonAM57xUsingOpenCLtoLevera geDSPA cceleration1 DesignSummaryThis TI Designis an exampleof how to DSPeasyfor developersand is usedfor applicationssuchas medicalimaging,currencycountersand sorters,visioninspectionsystems,and designshowsDSPacceleratorsfor theMonte-Carlosimulationusingthe Linux OpenCLprogramthat run on the a commonlyusedtool in manyfieldssuchas physics,communications.

3 Publicutilities,and Normal(Gaussian)distributedrandomnumbers equenceis an essentialpart of computationalload to generatelong normaldistributedrandomsequenceis manymodels,this load consumesmostof the designedto efficientlyexecutedigitalsignalalgorithm s,suchas the generationof designusesthe DSPto generatethe randomsequenceusinga standardOpenCLcoderunningonthe Cortex-A15processorunderthe showsthe GeneratingNormalDistributedRandomSequenc eTrueRandomNumberGenerationis generatedby s SecurityAcceleratorIP has atrue (PRNG)can be generatedbysoftwareand has generateuniformlydistributedrandomsequen ceare commonlyusemethodis the LinearCongruentialGenerator(LCG) LCGstartswith an initialseedandgeneratesrandomsequencebas edon Equation1:Xn+1 = (a Xn=c) Mod(M)(1)The followingare valuesand theirdescriptions:X0 a seedM the moduloa the multiplierc the incrementUndercertainconditions,the lengthof the sequence(the numberof randomnumbersbeforethesequencestartsrepe ating)is generatesnumbersthat are pseudo-uniformlydistributedbetween1 and M.

4 ScalingLCGsequenceto a uniformlydistributedsequencein the rangeof[ 1, 1] is (X)P [X] log P [X]c= -= c= c September2015 SubmitDocumentationFeedbackCopyright 2015,TexasInstrumentsIncorporatedMonte-C arloSimulationonAM57xUsingOpenCLtoLevera geDSPA ccelerationTo convertuniformlydistributedrandomsequenc einto a NormalGaussianrandomsequence,the designusesthe polarformof the Box-Mullertransformation(seeReference1 in Section4).The NormalGaussiandistributionhas two parameters,the average,and the a sequenceof N randomvariables:X (n), n = 1,..NThe average(or E (X)) = ( X (n)) NStandardDeviation = sqrt [E(X m)2]For a standardnormaldistributioncase, = 0 and = get Gaussianrandomvariablesfromuniformlydist ributedrandomvariableis asfollows:1.

5 Get two uniformlydistributed( , ),x and y2. Calculatew = (x x + y y)3. If w < sqrt(( log (w) ) w)4. y1 = x y5. y2 = y wY1 and Y2 are two ,SequenceLength,and ParallelComputationMultipletestsare suggestedin the literaturefor the randomness of a NormalRandomsequence: Havethe correctdistribution(lim (1 n S(X (n)) ~ N (0,1) No predictability(Afterreachingthe lengthof the sequence,the sequencebeginsto preferableto shortersequences.) Auto-correlationgoesto infinite,crossingcorrelationgoesto zero (lim (S (X (n) X (n)) ) (lim (s (X (n) X (n k)) 0)Measurethe entropy lack of orderor predictability;For a finitesequenceX, the entropyis definedinthe formulain Equation1.))))

6 (seethe discussionin Reference2 in Section4).Figure2. Equation2 Manypublicationsdiscusshow to choosethe constantsa, M, and c, and the initialseedx0 to achievepositiverandomnessfeatures(seeRef erence3 in Section4).TI chosea and M as constantsforEquation1 to ensurea long this TI designto use the full powerof the multipleDSPaccelerators,it mustmergemultipleindependentrandomsequen cesinto a singlerandomsequencewhilepreservingthe in Section4 suggestsa methodof choosingthe additiveconstantc for designusesa set of primenumbersfor parallelgeneratingof a portableheterogeneousstandardcomputingla nguagethat supportsthe easyuse of genericacceleratorsfor OpenCLapplications,knowledgeaboutthe architectureof the acceleratoris codecan run on differentdeviceswith (kernel)

7 Is writtenin C or otherstandardlanguage,and the systemknowswhatcompilerto use to convertthe codeinto an a genericOpenCLcodethat requiresno knowledgeof the the developerisfamiliarwith the acceleratorarchitecture,and is willingto give up portability,architectureoptimizedexecuta blemay be usedby the deviceCompute deviceCompute unitMultiple processing elementsCompute unitMultiple processing elementsCompute unitMultiple processing elementsCompute unitMultiple processing elementsCompute unitMultiple processing elementsCompute unitMultiple processing September2015 SubmitDocumentationFeedbackCopyright 2015,TexasInstrumentsIncorporatedMonte-C arloSimulationonAM57xUsingOpenCLtoLevera geDSPA ccelerationOpenCLstandardbodyis implementationof OpenCLon the AM57xis , see.

8 In this TI design,the DSPacceleratorcodeis developedusingANSIC ,the projectmaybe easilyportedto otherdeviceswith showsthe OpenCLPlatformModelA host is connectedto one or OpenCLdeviceis a collectionof one or morecomputeunitsthat sharethe caseof the AM57x ,the host is the the set of C66xDSPs,and the computeunit is a September2015 SubmitDocumentationFeedbackCopyright 2015, acceleratorsusedin this TI designare kernelcodeis writtenin standardANSIC, sono intrinsicor assemblylanguageis codetakesadvantageof the C66xmemoryarchitecture,and the eightfunctionalunitsinsidethe core. The codeusesTI real-timestandardoptimizedMathlibraryfor standardMathfunctionssuchassquareroot,lo g, one overx, and so on.

9 The runtimelibrarythat containsthesefunctionsis part of thestandardreleaseand is linkedby the devicethat supportsC musthavea similarlibrary(withthe sameor very similarsyntax)so portingthesefunctionsto anotherarchitectureis simple. The codetakesadvantageof the L1 DataSRAM part of the is a 32-KBareaof zerowait-stateaccesstime that is usedto storeand all acceleratorshaveL1 SRAM. The accessto the memoryis hard-codedin the DSPcode. To use the DSPinternalresources,eachcoregeneratestw o sequencesthat are latercombinedintoone algorithmfollowsReference4 in Section4 to ensurerandomnessof the combinedsequence. The samemethodusedin Reference4 in Section4 is usedto combinemultipleDSPcoresequencesinto a showsthe September2015 SubmitDocumentationFeedbackCopyright 2015, availableon a multitudeof programminglanguagesincludingC and C++.

10 This TI designusesC++ for the OpenCLcode,and ANSIC codefor the acceleratorkernelcodemaybe presentedas an ASCII string,or in separateC compilationof the kernelstringis doneduringrun time by the compilationof C files is doneduringthe buildprocess;however,linkingthecodeand gettingthe executablefromthe compiledfiles are doneduringrun processincreasesthe OpenCLruntimeoverhead;however,the OpenCLbeingportableto any OpenCLdeviceisadvantageousfor the usersare the benchmarkingof applicationsovermultipledevices,and the updatingor scalingof the September2015 SubmitDocumentationFeedbackCopyright 2015, AM57xEVMB ootableSDThe TI processorSDKis a unifiedset of softwarebuildingblocksthat TI processoris in the publicdomainand can be loadedandusedfree of and Figure6 showpart of the downloadpagefor the PROCESSOR-SDK-LINUX-AM57X02_00_01_07, see Reference5 in the Section4 Processor-SDK-LinuxAM57 XInstallPageTo burnan SD-bootablecardusinga Windowscomputer.


Related search queries