Commit a9d48382 authored by incardon's avatar incardon

Fixing compilation 4.8.5

parent d7c48264
......@@ -35,7 +35,9 @@ if(ENABLE_GPU)
elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 1 )
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=2915 --diag_suppress=2912 --diag_suppress=2913 --diag_suppress=111 --diag_suppress=186 --diag_suppress=611 " --expt-extended-lambda)
elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 2 )
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=2977 --diag_suppress=2976 --diag_suppress=2979 --diag_suppress=186" --expt-extended-lambda)
else()
message(FATAL_ERROR "CUDA is incompatible, version 9.2 is only supported")
endif()
......
......@@ -24,6 +24,11 @@ endif()
if (CUDA_FOUND)
target_compile_options(io PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
target_include_directories (io PUBLIC ${MPI_C_INCLUDE_DIRS})
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 )
add_compile_options( "-fabi-version=6" )
endif()
if (TEST_COVERAGE)
target_compile_options(io PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage">)
endif()
......
......@@ -56,12 +56,12 @@ struct csv_prp
template<typename T>
void operator()(T& t)
{
// This is the type of the csv column
typedef decltype(obj.template get<T::value>()) col_type;
// This is the type of the csv column
typedef typename boost::mpl::at<typename Tobj::type,T>::type col_type;
// Remove the reference from the column type
typedef typename boost::remove_reference<col_type>::type col_rtype;
typedef typename std::remove_all_extents<col_rtype>::type base_col_rtype;
// Remove the reference from the column type
typedef typename boost::remove_reference<col_type>::type col_rtype;
typedef typename std::remove_all_extents<col_rtype>::type base_col_rtype;
csv_value_str<col_rtype, is_csv_writable<base_col_rtype>::value >(obj.template get<T::value>(),str);
}
......
......@@ -137,7 +137,8 @@ struct csv_value_str
template<typename T,size_t N1, bool is_writable>
struct csv_value_str<T[N1], is_writable>
{
inline csv_value_str(const T v[N1], std::stringstream & str)
template<typename ArrObject>
inline csv_value_str(const ArrObject v, std::stringstream & str)
{
for (size_t i = 0 ; i < N1 ; i++)
str << "," << v[i];
......@@ -148,7 +149,8 @@ struct csv_value_str<T[N1], is_writable>
template<typename T,size_t N1,size_t N2, bool is_writable>
struct csv_value_str<T[N1][N2], is_writable>
{
inline csv_value_str(const T v[N1][N2], std::stringstream & str)
template<typename ArrObject>
inline csv_value_str(const ArrObject v[N1][N2], std::stringstream & str)
{
for (size_t i1 = 0 ; i1 < N1 ; i1++)
{
......@@ -164,7 +166,8 @@ struct csv_value_str<T[N1][N2], is_writable>
template<typename T,size_t N1,size_t N2,size_t N3, bool is_writable>
struct csv_value_str<T[N1][N2][N3], is_writable>
{
inline csv_value_str(const T v[N1][N2][N3], std::stringstream & str)
template<typename ArrObject>
inline csv_value_str(const ArrObject v[N1][N2][N3], std::stringstream & str)
{
for (size_t i1 = 0 ; i1 < N1 ; i1++)
{
......@@ -183,7 +186,8 @@ struct csv_value_str<T[N1][N2][N3], is_writable>
template<typename T,size_t N1,size_t N2,size_t N3,size_t N4, bool is_writable>
struct csv_value_str<T[N1][N2][N3][N4],is_writable>
{
inline csv_value_str(const T v[N1][N2][N3][N4], std::stringstream & str)
template<typename ArrObject>
inline csv_value_str(const ArrObject v[N1][N2][N3][N4], std::stringstream & str)
{
for (size_t i1 = 0 ; i1 < N1 ; i1++)
{
......
......@@ -125,17 +125,17 @@ struct vertex_prop
{cnt++; return ;}
// Create a property string based on the type of the property
if (typeid(T) == typeid(float))
if (std::is_same<T,float>::value)
v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"float\"/>\n";
else if (typeid(T) == typeid(double))
else if (std::is_same<T,double>::value)
v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"double\"/>\n";
else if (typeid(T) == typeid(int))
else if (std::is_same<T,int>::value)
v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"int\"/>\n";
else if (typeid(T) == typeid(long int))
else if (std::is_same<T,long int>::value)
v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"long\"/>\n";
else if (typeid(T) == typeid(bool))
else if (std::is_same<T,bool>::value)
v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"boolean\"/>\n";
else if (typeid(T) == typeid(std::string))
else if (std::is_same<T,std::string>::value)
v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"string\"/>\n";
}
......@@ -278,18 +278,20 @@ struct vertex_node
//! Create an entry for the attribute
if (T::value < n_attr)
{
typedef typename std::remove_reference<decltype(vo.template get<T::value>())>::type type_get;
// Create a property string based on the type of the property
if (typeid(decltype(vo.template get<T::value>())) == typeid(float))
if (std::is_same<type_get,float>::value)
v_node += " <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(double))
else if (std::is_same<type_get,double>::value)
v_node += " <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(int))
else if (std::is_same<type_get,int>::value )
v_node += " <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(long int))
else if (std::is_same<type_get,long int>::value)
v_node += " <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(bool))
else if (std::is_same<type_get,bool>::value)
v_node += " <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(std::string))
else if (std::is_same<type_get,std::string>::value)
v_node += " <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
}
......@@ -379,17 +381,17 @@ struct edge_prop
if (cnt < n_attr)
{
// Create a property string based on the type of the property
if (typeid(T) == typeid(float))
if (std::is_same<T,float>::value)
e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"float\"/>\n";
else if (typeid(T) == typeid(double))
else if (std::is_same<T,double>::value)
e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"double\"/>\n";
else if (typeid(T) == typeid(int))
else if (std::is_same<T,int>::value)
e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"int\"/>\n";
else if (typeid(T) == typeid(long int))
else if (std::is_same<T,long int>::value)
e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"long\"/>\n";
else if (typeid(T) == typeid(bool))
else if (std::is_same<T,bool>::value)
e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"boolean\"/>\n";
else if (typeid(T) == typeid(std::string))
else if (std::is_same<T,std::string>::value)
e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"string\"/>\n";
}
......@@ -510,18 +512,20 @@ struct edge_node
//! Create an entry for the attribute
if (T::value < n_attr)
{
typedef typename std::remove_reference<decltype(vo.template get<T::value>())>::type type_get;
// Create a property string based on the type of the property
if (typeid(decltype(vo.template get<T::value>())) == typeid(float))
if (std::is_same<type_get,float>::value)
e_node += " <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(double))
else if (std::is_same<type_get,double>::value)
e_node += " <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(int))
else if (std::is_same<type_get,int>::value)
e_node += " <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(long int))
else if (std::is_same<type_get,long int>::value)
e_node += " <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(bool))
else if (std::is_same<type_get,bool>::value)
e_node += " <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
else if (typeid(decltype(vo.template get<T::value>())) == typeid(std::string))
else if (std::is_same<type_get,std::string>::value)
e_node += " <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
}
......
......@@ -10,7 +10,7 @@
#include "VCluster/VCluster.hpp"
#include <hdf5.h>
#include "hdf5.h"
template <unsigned int type>
class HDF5_writer
......
......@@ -771,8 +771,6 @@ public:
// first we sort the vectors
recursive_sort(xy ... );
constexpr int size = sizeof...(xy);
size_t counters[sizeof...(X)];
memset(&counters,0,sizeof(counters));
......
......@@ -24,27 +24,27 @@
template <typename T> std::string getType()
{
// Create a property string based on the type of the property
if (typeid(T) == typeid(float))
if (std::is_same<T,float>::value)
return "float";
else if (typeid(T) == typeid(double))
else if (std::is_same<T,double>::value)
return "double";
else if (typeid(T) == typeid(char))
else if (std::is_same<T,char>::value)
return "char";
else if (typeid(T) == typeid(unsigned char))
else if (std::is_same<T,unsigned char>::value)
return "unsigned_char";
else if (typeid(T) == typeid(short))
else if (std::is_same<T,short>::value)
return "short";
else if (typeid(T) == typeid(unsigned short))
else if (std::is_same<T,unsigned short>::value)
return "unsigned_short";
else if (typeid(T) == typeid(int))
else if (std::is_same<T,int>::value)
return "int";
else if (typeid(T) == typeid(unsigned int))
else if (std::is_same<T,unsigned int>::value)
return "unsigned_int";
else if (typeid(T) == typeid(long int))
else if (std::is_same<T,long int>::value)
return "int";
else if (typeid(T) == typeid(unsigned long int))
else if (std::is_same<T,unsigned long int>::value )
return "unsigned_int";
else if (typeid(T) == typeid(bool))
else if (std::is_same<T,bool>::value )
return "bit";
return "";
......
......@@ -117,10 +117,36 @@ struct prop_out_g
// if there is the next element
while (it.isNext())
{
if (vg.get(k).dom.isInside(it.get().toPoint()) == true)
v_out += "1.0\n";
if (ft == file_type::ASCII)
{
if (vg.get(k).dom.isInside(it.get().toPoint()) == true)
{
float flag = 1.0;
flag += vg.get(k).g.getFlag(it.get()) * 2;
v_out += std::to_string(flag) + "\n";
}
else
{
float flag = 0.0;
flag += vg.get(k).g.getFlag(it.get()) * 2;
v_out += std::to_string(flag) + "\n";
}
}
else
v_out += "0.0\n";
{
if (vg.get(k).dom.isInside(it.get().toPoint()) == true)
{
float flag = 1.0;
flag = swap_endian_lt(flag);
v_out.append((const char *)&flag,sizeof(flag));
}
else
{
float flag = 0.0;
flag = swap_endian_lt(flag);
v_out.append((const char *)&flag,sizeof(flag));
}
}
// increment the iterator and counter
++it;
......@@ -142,8 +168,8 @@ template <typename pair>
class VTKWriter<pair,VECTOR_GRIDS>
{
//! Vector of grids
openfpm::vector< ele_g<typename pair::first,typename pair::second> > vg;
openfpm::vector< ele_g<typename pair::first,typename pair::second> > vg;
/*! \brief Get the total number of points
*
* \return the total number
......@@ -380,9 +406,9 @@ public:
prop_out_g< ele_g<typename pair::first,typename pair::second>, typename pair::second > pp(point_data, vg, prop_names, ft);
if (prp == -1)
boost::mpl::for_each< boost::mpl::range_c<int,0, pair::first::value_type::max_prop> >(pp);
{boost::mpl::for_each< boost::mpl::range_c<int,0, pair::first::value_type::max_prop> >(pp);}
else
boost::mpl::for_each< boost::mpl::range_c<int,prp, prp> >(pp);
{boost::mpl::for_each< boost::mpl::range_c<int,prp, prp> >(pp);}
// Add the last property
pp.lastProp();
......
......@@ -371,7 +371,9 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
// if the type is not supported return
if (type.size() == 0)
{
#ifndef DISABLE_ALL_RTTI
std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " the type " << demangle(typeid(ctype).name()) << " is not supported by vtk\n";
#endif
return "";
}
......
......@@ -89,7 +89,9 @@ template<unsigned int i, typename ele_g, bool has_attributes> std::string get_po
// if the type is not supported skip-it
if (type.size() == 0)
{
#ifndef DISABLE_ALL_RTTI
std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " the type " << demangle(typeid(ctype).name()) << " is not supported by vtk\n";
#endif
return "";
}
......@@ -312,7 +314,7 @@ struct meta_prop<I, ele_g,St,T[N1],is_writable>
{v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())[i1]) + " ";}
if (N1 == 2)
{v_out += "0.0";}
{v_out += std::to_string((decltype(vg.get(k).g.template get<I::value>(it.get())[0])) 0);}
v_out += "\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment