aboutsummaryrefslogtreecommitdiff
path: root/Tools/CodeGen/CodeGen.m
Commit message (Collapse)AuthorAge
* CodeGen.m: Add a better IndentBlock functionIan Hinder2012-04-18
|
* CodeGen*.m: Use DefFn to define functionsIan Hinder2011-10-07
|
* Split CodeGen.m into CodeGen.m, CodeGenC.m and CodeGenCactus.mIan Hinder2011-10-07
| | | | | | | - CodeGenC.m still contains Fortran variants. These might be moved into CodeGenFortran.m. - Several other modules essentially need to pull in all three packages due to newly broken abstraction barriers. This can be fixed incrementally. - Indent and format all three files consistently
* CodeGen.m: Add strict pattern checking to all functionsIan Hinder2011-10-06
|
* CodeGen.m: Remove intersperse function and replace use by RiffleIan Hinder2011-10-06
|
* CodeGen.m: Rewrite FlattenBlock and make it more strictIan Hinder2011-10-06
|
* CodeGen.m: Make GridName return a string rather than an expressionIan Hinder2011-10-06
| | | | The expression it was returning was not a valid CodeGen block
* CodeGen.m: Add missing comma in GenericGridLoopTraditionalIan Hinder2011-10-06
|
* Define/declare identifier "t" (holding cctk_time) in some missing placesErik Schnetter2011-10-02
|
* Use imin and imax instead of min and max as formal argument names for loop ↵Erik Schnetter2011-09-29
| | | | body functions
* CodeGen.m: Add StorePartialVariableInLoopErik Schnetter2011-09-29
|
* CodeGen.m: Replace Cos, Sin, Tan with kcos, ksin, ktan in calculationsErik Schnetter2011-09-29
| | | | Also add some optimisations
* Add Stringify to convert C code statements to a C stringErik Schnetter2011-09-29
| | | | This takes a list of code statements and returns a C string containing this code. This is used to capture the generated C code and pass it to the OpenCL run time.
* Add function ParenthesisErik Schnetter2011-09-29
| | | | This is used to encapsulate upwind finite differencing operations in McLachlan to simplify substitutions. Similar to a parenthesis, this function does nothing.
* CodeGen.m: Make SwitchStatement public and improve formattingIan Hinder2011-09-18
|
* Further IfThen optimisationsErik Schnetter2011-08-30
|
* Support multi-argument Max/MinErik Schnetter2011-08-30
| | | | Support multi-argument Max and Min calls in Kranc.
* Add Scalar[] which can be used to prevent vectorisation and use it for tests ↵Barry Wardell2011-06-19
| | | | in conditionals. Also add a couple more simplification rules for the vectorisation.
* Improve handling of ToReal and parameters in conditionalsIan Hinder2011-06-11
|
* Add option of using functions instead of macros for derivativesIan Hinder2011-06-09
| | | | | | This can help to fit the code in the instruction cache and improve performance. Enable this at compile time by defining the preprocessor macro KRANC_DIFF_FUNCTIONS.
* Correct vectorisation errors recently introducedErik Schnetter2011-05-27
| | | | | | | | | | | | (1) vec_load cannot be used on constants, it can only be used to access array elements. Replacing UseVectors by False is just a band aid. vec_load was attached to a routine defining and setting a variable; really, it should be attached to a routine accessing array elements, but Kranc doesn't use such an abstraction yet.(2) ToReal is introduced, but must be removed again for integer expressions such as the conditions controlling if statements. I added band-aid code to Conditional[] to remove it. The vectorization routines already handle IfThen, Pow etc., but Conditional isn't visible to them.
* Improve vectorisation optimisationsErik Schnetter2011-05-27
|
* Vectorisation correction for vector sizes > 2Erik Schnetter2011-05-27
| | | | | Correct the vectorisation code for vector sizes >2 when the array size is smaller than the vector size
* Tidy up grid indexing using CCTK_LSSH macroErik Schnetter2011-05-27
| | | | | | | Clean up the code that uses lssh. Note: Although most people don't know about lssh, it's defined by the flesh, and e.g. all standard Cactus boundary conditions use it. However, Carpet currently always sets lssh to lsh, so the difference is "hidden".
* Add dt variable for use in calculationsErik Schnetter2011-05-27
| | | | This adds to the dx, dy, dz that are already available.
* Support no-inline functions for derivatives in vectorised codeErik Schnetter2011-05-27
| | | | | | | | | Create two versions of the derivative operators, once as macro, and once as no-inline function. When a function is used, then the grid spacing 1/dx must be passed in explicitly. This was done differently before and is now slightly faster and shorter. The no-inline function reduces code size, and should probably also be available for the non-vectorised code, but this is not implemented.
* CodeGen.m: Make AssignVariableInLoop aware of vectorisationIan Hinder2011-05-25
|
* CodeGen.m: Add if-then-else style conditionalIan Hinder2011-05-25
|
* Improved common subexpression elimination support.Barry Wardell2011-03-16
|
* Fix bugs in ReplacePowers which broke vectorised codeIan Hinder2011-01-24
| | | Both vectorised and unvectorised versions now pass the ML_BSSN_Test testsuites
* Only vectorise FD variables and macros when UseVectors is setIan Hinder2011-01-22
|
* Use correct LoopControl macros when UseVectors is unsetIan Hinder2011-01-22
|
* Only vectorise when converting local variables if UseVectors is setIan Hinder2011-01-22
|
* Use DataType function for CCTK_REAL / CCTK_REAL_VECIan Hinder2011-01-22
|
* Only vectorise in ReplacePowers if UseVectors is setIan Hinder2011-01-22
|
* Use ptrdiff_t instead of int for indices; this avoids many 32-to-64-bit ↵Erik Schnetter2010-12-23
| | | | | | conversions and thus generates faster code. Correct code generation for static functions that evaluate the derivative operators.
* Use C++ for all source files.Erik Schnetter2010-12-06
| | | | Add extern "C" to scheduled functions.
* Rewrite vectorisation infrastructure:Erik Schnetter2010-12-06
| | | | | | | | Use "k" prefix more consistently in arithmetic macros. Improve vector code generation patterns. Move all vectorisation run-time out of Kranc and into a new thorn LSUThorns/Vectors, so that non-Kranc thorns can also use it.
* Implement vectorisationIan Hinder2010-11-23
| | | | This is Erik's vectorisation working tree from 13-Oct-2010
* Add support for vectorisation of generated code.Ian Hinder2010-11-23
| | | | Vectorisation needs to be explicitly enabled by setting -DKRANC_VECTORS at build time.
* CodeGen.m: Add Quote function for conveniently adding double quotesIan Hinder2010-06-04
|
* Revert "Revert "Merge branch 'master' of github.com:ianhinder/Kranc""Roland Haas2010-05-06
| | | | | | | | | | | Merge was correct after all. This reverts commit 04dfdcd32eec91978ba050a472aae2a6e7091c05. Conflicts: Tools/CodeGen/CalculationFunction.m Tools/CodeGen/Thorn.m
* Revert "Add support for vectorisation of generated code."Erik Schnetter2010-05-03
| | | | This reverts commit 8e006230f24be02831d390eaad9b90b7a7c77d2c.
* Revert "Merge branch 'master' of github.com:ianhinder/Kranc"Erik Schnetter2010-05-02
| | | | | This reverts commit 815307e624fdb8c0ee2eefc644c9bbd8244ad7f2, reversing changes made to 8e006230f24be02831d390eaad9b90b7a7c77d2c.
* Merge branch 'master' of github.com:ianhinder/KrancErik Schnetter2010-05-02
|\ | | | | | | | | | | Conflicts: Tools/CodeGen/CalculationFunction.m Tools/CodeGen/Thorn.m
| * Replace sym context with Kranc context in Kranc.m. Also move interface ↵Ian Hinder2010-04-03
| | | | | | | | functions into Interface.m.
* | Add support for vectorisation of generated code.Erik Schnetter2010-05-02
|/ | | | Vectorisation needs to be explicitly enabled by setting -DKRANC_VECTORS at build time.
* Fix typo in licence at top of every fileIan Hinder2010-03-17
|
* Remove support for sub-block grid functionsIan Hinder2010-03-17
| | | | | | | | The idea of sub-block grid functions was to allow a calculation to operate differently on different sub-blocks of the domain. This was never used, and is now achieved by calling the calculation with arguments which specify the region of the domain to loop over. Hence, the old sub-block code is being removed.
* Declare variables only when they are first usedIan Hinder2010-03-10
| | | | | | | This allows simultaneous declaration and assignment as per Erik's previous commit, which seems to give a noticeable performance increase, at least with the PGI compiler on Kraken, and also allows multiple assignments to the same variable in a single calculation.