Skip to content
Snippets Groups Projects
Select Git revision
  • cbbf958d1cedc84416e786130490f4c700c2f320
  • develop default protected
  • feature/gmsh-reader
  • origin/stage/bouguettaia
  • feature/kinetic-schemes
  • feature/reconstruction
  • feature/local-dt-fsi
  • feature/composite-scheme-sources
  • feature/composite-scheme-other-fluxes
  • feature/serraille
  • feature/variational-hydro
  • feature/composite-scheme
  • hyperplastic
  • feature/polynomials
  • feature/gks
  • feature/implicit-solver-o2
  • feature/coupling_module
  • feature/implicit-solver
  • feature/merge-local-dt-fsi
  • master protected
  • feature/escobar-smoother
  • v0.5.0 protected
  • v0.4.1 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0 protected
  • Kidder
  • v0.0.4 protected
  • v0.0.3 protected
  • v0.0.2 protected
  • v0 protected
  • v0.0.1 protected
33 results

test_ASTSymbolInitializationChecker.cpp

Blame
    • Stéphane Del Pino's avatar
      cbbf958d
      Add location of variable creation to attributes of symbol tale · cbbf958d
      Stéphane Del Pino authored
      Additionally store position of the end of the declaration instruction so that
      when searching a symbol in a table one also check that the declaration point has
      been passed.
      
      This fix issues generated by the storage of symbol tables within node
      description. The following code is now interpreted correctly
      
      ``
      Z x = 1;
      {
        Z x = x + 1;
        cout << x << "\n";
      }
      cout << x << "\n";
      ``
      
      It now produces the expected output
      
      ``
      2
      1
      ``
      cbbf958d
      History
      Add location of variable creation to attributes of symbol tale
      Stéphane Del Pino authored
      Additionally store position of the end of the declaration instruction so that
      when searching a symbol in a table one also check that the declaration point has
      been passed.
      
      This fix issues generated by the storage of symbol tables within node
      description. The following code is now interpreted correctly
      
      ``
      Z x = 1;
      {
        Z x = x + 1;
        cout << x << "\n";
      }
      cout << x << "\n";
      ``
      
      It now produces the expected output
      
      ``
      2
      1
      ``
    ConnectivityMatrix.hpp 2.00 KiB
    #ifndef CONNECTIVITY_MATRIX_HPP
    #define CONNECTIVITY_MATRIX_HPP
    
    #include <Kokkos_Core.hpp>
    #include <Kokkos_StaticCrsGraph.hpp>
    
    class ConnectivityMatrix
    {
     private:
      typedef Kokkos::StaticCrsGraph<unsigned int, Kokkos::HostSpace> HostMatrix;
      HostMatrix m_host_matrix;
    
     public:
      typedef HostMatrix::row_map_type HostRowType;
    
      const auto& entries() const
      {
        return m_host_matrix.entries;
      }
    
      const auto& rowsMap() const
      {
        return m_host_matrix.row_map;
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto numEntries() const
      {
        return m_host_matrix.entries.extent(0);
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto numRows() const
      {
        return m_host_matrix.numRows();
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto rowConst(const size_t& j) const
      {
        return m_host_matrix.rowConst(j);
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto rowMap(const size_t& j) const
      {
        return m_host_matrix.row_map[j];
      }
    
      KOKKOS_INLINE_FUNCTION
      ConnectivityMatrix(const std::vector<std::vector<unsigned int>>& initializer)
          : m_host_matrix(Kokkos::create_staticcrsgraph<HostMatrix>("connecticity_matrix", initializer))
      {
        ;
      }
    
      KOKKOS_INLINE_FUNCTION
      ConnectivityMatrix(const ConnectivityMatrix& connecticity_matrix,std::vector<std::vector<unsigned int>>& initializer)
          : m_host_matrix(Kokkos::create_staticcrsgraph<HostMatrix>("connecticity_matrix", initializer))
      {
        ;
      }
    
      [[deprecated("Must only define connectivities so that only unsigned int should be treated")]]
      ConnectivityMatrix(const std::vector<std::vector<unsigned short>>& initializer)
      : m_host_matrix(Kokkos::create_staticcrsgraph<HostMatrix>("connecticity_matrix", initializer))
      {
        ;
      }
    
      ConnectivityMatrix& operator=(const ConnectivityMatrix&) = default;
      ConnectivityMatrix& operator=(ConnectivityMatrix&&) = default;
    
      ConnectivityMatrix() = default;
      ConnectivityMatrix(const ConnectivityMatrix&) = default;
      ConnectivityMatrix(ConnectivityMatrix&&) = default;
      ~ConnectivityMatrix() = default;
    };
    
    #endif // CONNECTIVITY_MATRIX_HPP