Difference between revisions of "Code Sprint 2017-04-04"

From VTKM
Jump to navigation Jump to search
Line 3: Line 3:
 
http://ix.cs.uoregon.edu/~hank/vtkm17.html
 
http://ix.cs.uoregon.edu/~hank/vtkm17.html
  
Possible topics:
+
=== Possible topics ===
  
 
* Sources (wavelet, tangle field, [https://github.com/PETTT/miniIO miniIO])
 
* Sources (wavelet, tangle field, [https://github.com/PETTT/miniIO miniIO])
Line 14: Line 14:
 
* Clean up old [https://gitlab.kitware.com/vtk/vtk-m/merge_requests merge requests]
 
* Clean up old [https://gitlab.kitware.com/vtk/vtk-m/merge_requests merge requests]
 
* Redesign error reporting
 
* Redesign error reporting
 +
 +
=== Participants ===
  
 
{|
 
{|
Line 36: Line 38:
 
| David Pugmire || ORNL ||
 
| David Pugmire || ORNL ||
 
|}
 
|}
 +
 +
=== Quick Poll on Signature Types ===
 +
 +
VTK-m's heavy use of templates requires many type aliases to be defined. Originally we used <tt>typedef</tt> exclusively for this, but recently we moved to <tt>using</tt>. The effect of the two keywords is equivalent, but we like the syntax of <tt>using</tt> better because it brings the name being defined to the front of the statement, which makes it easier to see and read.
 +
 +
One current disagreement the designers have is whether we should use <tt>using</tt> for signatures (like <tt>ControlSignature</tt> and <tt>ExecutionSignature</tt>) or we should keep using <tt>typedef</tt>. The argument for <tt>using</tt> is that it cleanly separates the signature from the alias name. The argument for <tt>typedef</tt> is that the declaration itself looks like a function prototype declaration and will be easier for end users to grok the high level concept.
 +
 +
Here is a comparison. The following code is copied from a worklet for extract surface. It is nontrivial but not abnormal. The current implementation here uses <tt>typedef</tt>
 +
 +
<source lang="cpp">
 +
    typedef void ControlSignature(CellSetIn cellset,
 +
                                  FieldOut<> faceHashes,
 +
                                  FieldOut<> originCells,
 +
                                  FieldOut<> originFaces);
 +
    typedef void ExecutionSignature(_2,
 +
                                    _3,
 +
                                    _4,
 +
                                    CellShape,
 +
                                    FromIndices,
 +
                                    InputIndex,
 +
                                    VisitIndex);
 +
</source>
 +
 +
Now here is the same declarations using the <tt>using</tt> keyword instead.
 +
 +
<source lang="cpp">
 +
    using ControlSignature = void(CellSetIn cellset,
 +
                                  FieldOut<> faceHashes,
 +
                                  FieldOut<> originCells,
 +
                                  FieldOut<> originFaces);
 +
    using ExecutionSignature = void(_2,
 +
                                    _3,
 +
                                    _4,
 +
                                    CellShape,
 +
                                    FromIndices,
 +
                                    InputIndex,
 +
                                    VisitIndex);
 +
</source>
 +
 +
Since we have several users from different backgrounds, this is a good time to collect several opinions.

Revision as of 11:20, 29 March 2017

Our third code sprint was held on April 4-6, 2017 and was hosted at the University of Oregon.

http://ix.cs.uoregon.edu/~hank/vtkm17.html

Possible topics

  • Sources (wavelet, tangle field, miniIO)
  • Hash function bake off
  • Image comparison testing
  • Filters compiled into library
  • Dynamic classes
  • Fix exports in rendering library for OSX
  • Build simple "tutorial" exercises
  • Clean up old merge requests
  • Redesign error reporting

Participants

Participant From Project
Dongliang Chu ORNL
Mark Kim ORNL
James Kress ORNL
Matt Larsen LLNL
David Lonie Kitware
Rob Maynard Kitware
Ken Moreland SNL
Thomas Otahal SNL
David Pugmire ORNL

Quick Poll on Signature Types

VTK-m's heavy use of templates requires many type aliases to be defined. Originally we used typedef exclusively for this, but recently we moved to using. The effect of the two keywords is equivalent, but we like the syntax of using better because it brings the name being defined to the front of the statement, which makes it easier to see and read.

One current disagreement the designers have is whether we should use using for signatures (like ControlSignature and ExecutionSignature) or we should keep using typedef. The argument for using is that it cleanly separates the signature from the alias name. The argument for typedef is that the declaration itself looks like a function prototype declaration and will be easier for end users to grok the high level concept.

Here is a comparison. The following code is copied from a worklet for extract surface. It is nontrivial but not abnormal. The current implementation here uses typedef

    typedef void ControlSignature(CellSetIn cellset,
                                  FieldOut<> faceHashes,
                                  FieldOut<> originCells,
                                  FieldOut<> originFaces);
    typedef void ExecutionSignature(_2,
                                    _3,
                                    _4,
                                    CellShape,
                                    FromIndices,
                                    InputIndex,
                                    VisitIndex);

Now here is the same declarations using the using keyword instead.

    using ControlSignature = void(CellSetIn cellset,
                                  FieldOut<> faceHashes,
                                  FieldOut<> originCells,
                                  FieldOut<> originFaces);
    using ExecutionSignature = void(_2,
                                    _3,
                                    _4,
                                    CellShape,
                                    FromIndices,
                                    InputIndex,
                                    VisitIndex);

Since we have several users from different backgrounds, this is a good time to collect several opinions.