AnsweredAssumed Answered

Bolt video on YouTube

Question asked by bsp2020 on Apr 29, 2013
Latest reply on May 13, 2013 by jaidotsh

Hi,

I'm trying out the Bolt library and watched the Bolt video on YouTube (http://www.youtube.com/watch?v=p1eWgRa-JQE). However, when I typed in the example code, it does not compile. I can't figure out what I did wrong. Please, help.

 

// HelloWorld.cpp : Defines the entry point for the console application.

//

 

#include "stdafx.h"

#include <bolt/cl/transform.h>

#include <iostream>

#include <algorithm>

 

BOLT_FUNCTOR(StringFunctor,

struct StringFunctor

{

    char operator() ( const char& in )

    {

        return in + 1;

    };

};

);

 

BOLT_CREATE_TYPENAME( char );

 

int _tmain(int argc, _TCHAR* argv[])

{

    // Initialize and print an input string

    std::string inputString( "GdkknVnqkc" );

    std::cout << "input string: " << inputString << std::endl;

 

    // Create input and ourput buffers

    std::vector< char > inputVec( inputString.begin(), inputString.end() );

    std::vector< char > outputVec( inputString.size() );

 

    // This calls into OpenCL to do the work

    bolt::cl::transform( inputVec.begin(), inputVec.end(), outputVec.begin(), StringFunctor( ) );

 

    // trasfer data to host memory from device memory.

    std::string outputString( outputVec.data(), outputVec.size() );

    std::cout << "output string: " << outputString << std::endl;

 

          return 0;

}

 

The error I'm getting is

D:\Download\AMD\Bolt 1.0-Beta_VS2012\include\bolt/cl/clcode.h(87): error C2338: Bolt< error >: Unknown typename; define missing TypeName with Bolt provided macro's

 

I"m sure I'm missing something simple. But, I can't figure it out.

Outcomes