AnsweredAssumed Answered

does bolt(opencl) support custom user type "BigInteger"?

Question asked by allenwaye on Jan 4, 2014
Latest reply on Jan 27, 2014 by jaidotsh

Hell there,

my app uses "BigInteger" for MP seeking, the Fuctor uses "BigInteger", all the codes work on CPUs, however the DebugLog not working, the IntelTBB not working, after i tried the configurations and online tutorial many times, when i switch to GPU, the underlying opencl didn't not support "BigInterger", is there any way the bolt will make opencl support custom user type?


code snippet for example:

#include "stdafx.h"

#include "BigIntegerLibrary.hh"

#include <bolt/cl/transform.h>

#include <bolt/cl/device_vector.h>

#include <bolt/statisticalTimer.h>


#include "bolt/BoltLog.h"

using namespace std;


struct IntFunctor


    BigInteger operator() (const BigInteger& in)


        return in * in;





BOLT_TEMPLATE_REGISTER_NEW_ITERATOR( bolt::cl::device_vector, int, BigInteger);



BOLTLOG::CaptureLog *xyz =  BOLTLOG::CaptureLog::getInstance();


  std::vector< BOLTLOG::FunPaths> paths;

  bolt::cl::control ctl = bolt::cl::control::getDefault( );

  //ctl.setForceRunMode( bolt::cl::control::MultiCoreCpu );

  vector<BigInteger> inputInt(5);

  for(int i = 0; i< inputInt.size();++i)


  inputInt[i] = BigInteger(i+1);


  vector<BigInteger> outputInt(5);

  bolt::cl::transform(inputInt.begin(), inputInt.end(), outputInt.begin(),IntFunctor());



  for(std::vector< BOLTLOG::FunPaths>::iterator parse=paths.begin(); parse!=paths.end(); parse++)


  std::cout<<(*parse).fun<<"\n";  // prints function number as defined in Boltlog.h

  std::cout<<(*parse).path<<"\n";  // prints the path number – 0 for Multicore TBB, 1 for OpenCL™ GPU, 2 for OpenCL™ CPU and 3 for Serial.

  std::cout<<(*parse).msg<<"\n";  // prints the Path taken