Skip to content
Snippets Groups Projects

Implemented use_gpu_memory_on_task option

Merged Ghost User requested to merge issue136 into main
2 files
+ 71
0
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 45
0
/****************************************************************************
** LinkTest **
*****************************************************************************
** Copyright (c) 2008-2022 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/
#include "argument_vector_bool.h"
#include <sstream>
#include <ios>
#include<algorithm>
std::vector<bool> Argument_Vector_Bool::getValue() const {
std::vector<bool> res;
copy(_value.begin(), _value.end(), back_inserter(res));
return res;
}
std::string Argument_Vector_Bool::getString() const {
std::stringstream ss;
ss << "[";
ss << std::boolalpha;
for(bool b: _value) {
ss << b << ",";
}
ss << "]";
return ss.str();
}
Argument_Vector_Bool::Argument_Vector_Bool (const std::string str){
if(str.front() != '[' || str.back() != ']') {
throw std::invalid_argument(str + " needs to be a list such as [] and [1,0,1,1]");
}
std::stringstream values(str.substr(1, str.size() -1));
std::string value;
while(std::getline(values, value, ','))
{
std::stringstream boolStr;
bool b;
boolStr << value;
boolStr >> b;
_value.push_back(b);
}
}
\ No newline at end of file
Loading