Results 1 to 4 of 4

Thread: Bitwise ANDing, ORing, amd XORing very long bitmaps

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    2

    Bitwise ANDing, ORing, amd XORing very long bitmaps

    Hello,

    I would like to hook into the additional power of my GPU. My problem is that I must perform bitwise AND, XOR and OR on very long bitmaps. The bitmaps could perhaps be 800 megabits. I would also wish to count bits that were "on" in any bitmap and know their place.

    Pardon my ignorance, but is this possible in opencl? I am researching the best method to do this and if it is possible, I will put in enormous effort to learn opencl and will deal with the inevitible brain-ache and laptop rage - I am a BASIC programmer by trade.

    Regards, Peter.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Bitwise ANDing, ORing, amd XORing very long bitmaps

    Let's see if I understand. You have about 100 megabytes of data (800 megabits) and you want to perform some bitwise operations like AND, XOR, OR and population count (number of bits enabled) and you have no previous experience in C. Is this correct?

    Under the circumstances above I personally would not bother learning OpenCL. The kind of operations you want to run can be implemented quite easily and efficiently in a CPU using traditional programming methods.

    For starters, you may want to implement these algorithms in C or C++. With minor modifications you could also make them work in parallel using OpenMP.

    You can certainly do this in OpenCL if you want, but it will take more effort and I'm not sure you see great gains compared to C + OpenMP.

    Finally, and in the interest of full disclosure, notice that OpenMP always runs on your CPU while OpenCL runs on either your CPU or your GPU (or both) -- the choice it's up to you.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    2

    Re: Bitwise ANDing, ORing, amd XORing very long bitmaps

    Thank you.

    I am glad that opencl can cope. Your assumption about the amount of data is slightly incorrect. Each of the 800 megabits corresponds to a record number, and there may be many bitmaps to manipulate per dataset. I would expect to perform 100 or so bitmap ANDs per search. I need some serious parallel power to do what I need with the large amount of data I have, and with a response time of under a second.

    Peter.

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Bitwise ANDing, ORing, amd XORing very long bitmaps

    The problem I see with the sort of data processing you need is that the ratio of ALUs versus the amount of memory that needs to be transferred to the device is very low for this to run efficiently on a GPU.

    I would either try with OpenMP or OpenCL on a CPU. Good luck
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Replies: 2
    Last Post: 10-11-2011, 12:57 AM
  2. How to use long long type?
    By Rui in forum OpenCL
    Replies: 1
    Last Post: 03-29-2010, 10:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •