src/runtime_src/xocl/xclbin/xclbin.cpp
std::string
xclbin::symbol::arg::
get_string_value(const unsigned char* data) const
{
  std::stringstream sstr;
  if ( (type == "float") || (type == "double") ) {
    //Handle float/double by casting
    if (hostsize == 64)
      sstr << *(reinterpret_cast<const double*> (data));
    else
      sstr << *(reinterpret_cast<const float*> (data));
  }
  else {
    //Integral type: char,short,int,long and their unsigned versions
    //Handle all integral types here
    sstr << "0x";
    for (int i = hostsize-1; i >= 0; --i) {
      //data[i] has to be sent in as an integer to the ostream,
      //if not data[i] gets interpreted as character (ie. non-ascii characters in output)
      sstr << std::hex << std::setw(2) << std::setfill('0') << (unsigned int)data[i];
    }
  }
  return sstr.str();
}
// Convert kernel arg data to string per type of argument
// Interpret the passed data pointer as per the type of the arg and
// return a string representation of it.
Convert kernel arg data to string per type of argument
Interpret the passed data pointer as per the type of the arg and
return a string representation of it.
Convert kernel arg data to string per type of argument Interpret the passed data pointer as per the type of the arg and return a string representation of it .
std::string
xclbin::symbol::arg::
get_string_value(const unsigned char* data) const
{
  std::stringstream sstr;
  if ( (type == "float") || (type == "double") ) {
    if (hostsize == 64)
      sstr << *(reinterpret_cast<const double*> (data));
    else
      sstr << *(reinterpret_cast<const float*> (data));
  }
  else {
    sstr << "0x";
    for (int i = hostsize-1; i >= 0; --i) {
      sstr << std::hex << std::setw(2) << std::setfill('0') << (unsigned int)data[i];
    }
  }
  return sstr.str();
}
std :: string xclbin :: symbol :: arg :: get_string_value ( const unsigned char * data ) const { std :: stringstream sstr ; if ( ( type == " " ) || ( type == " " ) ) { if ( hostsize == 64 ) sstr << * ( reinterpret_cast < const double * > ( data ) ) ; else sstr << * ( reinterpret_cast < const float * > ( data ) ) ; } else { sstr << " " ; for ( int i = hostsize - 1 ; i >= 0 ; -- i ) { sstr << std :: hex << std :: setw ( 2 ) << std :: setfill ( ' ' ) << ( unsigned int ) data [ i ] ; } } return sstr . str ( ) ; }
Convert kernel arg data to string per type of argument
Interpret the passed data pointer as per the type of the arg and
return a string representation of it.
Convert kernel arg data to string per type of argument Interpret the passed data pointer as per the type of the arg and return a string representation of it .
//Handle float/double by casting //Integral type: char,short,int,long and their unsigned versions //Handle all integral types here //data[i] has to be sent in as an integer to the ostream, //if not data[i] gets interpreted as character (ie. non-ascii characters in output)