 016f15bd0e
			
		
	
	
	
	
	016f15bd0e* Remove json config code This improves compile/test times a bit. The json->toml upgrade paths are removed as well. In the unlikely case someone needs to upgrade from v19.x and earlier, the solution is to run a v2x node (prior to this change) to perform the upgrade. Closes #3530 * Remove stat_config json deserialization as well * Remove stat_config header's deserialize_json and jsonconfig::read_and_update
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			919 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			919 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include <nano/lib/jsonconfig.hpp>
 | |
| #include <nano/lib/tomlconfig.hpp>
 | |
| #include <nano/node/openclconfig.hpp>
 | |
| 
 | |
| nano::opencl_config::opencl_config (unsigned platform_a, unsigned device_a, unsigned threads_a) :
 | |
| 	platform (platform_a),
 | |
| 	device (device_a),
 | |
| 	threads (threads_a)
 | |
| {
 | |
| }
 | |
| 
 | |
| nano::error nano::opencl_config::serialize_toml (nano::tomlconfig & toml) const
 | |
| {
 | |
| 	toml.put ("platform", platform);
 | |
| 	toml.put ("device", device);
 | |
| 	toml.put ("threads", threads);
 | |
| 
 | |
| 	// Add documentation
 | |
| 	toml.doc ("platform", "OpenCL platform identifier");
 | |
| 	toml.doc ("device", "OpenCL device identifier");
 | |
| 	toml.doc ("threads", "OpenCL thread count");
 | |
| 
 | |
| 	return toml.get_error ();
 | |
| }
 | |
| 
 | |
| nano::error nano::opencl_config::deserialize_toml (nano::tomlconfig & toml)
 | |
| {
 | |
| 	toml.get_optional<unsigned> ("platform", platform);
 | |
| 	toml.get_optional<unsigned> ("device", device);
 | |
| 	toml.get_optional<unsigned> ("threads", threads);
 | |
| 	return toml.get_error ();
 | |
| }
 |