Click here to Skip to main content
15,883,623 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer17-Apr-18 21:45
leon de boer17-Apr-18 21:45 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX18-Apr-18 3:49
jimNLX18-Apr-18 3:49 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer18-Apr-18 15:27
leon de boer18-Apr-18 15:27 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX9-May-18 9:18
jimNLX9-May-18 9:18 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer9-May-18 16:11
leon de boer9-May-18 16:11 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX11-May-18 6:23
jimNLX11-May-18 6:23 
QuestionOpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349219-Mar-18 19:19
User 1370349219-Mar-18 19:19 
AnswerRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer19-Mar-18 23:47
leon de boer19-Mar-18 23:47 
You can't possibly be using that code it's rubbish and it wouldn't even compile
Even if I assume obvious errors what is left is a really dangerous piece of code that has lethal typecast problems that will blowup in your face

First the array definitions are garbage and can't compile like that and n isn't even defined and you need a pointer for a new array. You have a capital N defined which I assume is supposed to be used for the arrays. So my guess what you meant to type is
C++
int n = 256; // number of bits in a row/col (or any number that is evenly divisible by 64)
unsigned long long *A = new unsigned long long [n*n / 64]; // stores bits in 64-bit integers
unsigned long long *B = new unsigned long long [n*n / 64]; // for example, one row consists of 256 bits and uses 4x64-bit integers to store them

However that just leads us to look at function bitproduct which starts playing around with ulong* pointers.

The usual definition of ulong is an unsigned long which isn't an unsigned long long which the array are created as.
So now I am really confused bitproduct can't be using those arrays because they aren't the right type unless you were
really crazy and forced a typecast at which point all hell breaks out.

So what exactly is a ulong and what is being passed to bitproduct as arrays????
I don't know were to go from there it's a mess.

Now can I make a really strong recommendation to you since you are playing around with fixed bit types that you use the C/C++ standard unit for that.

At the top of your code type
#define <stdint.h>

stdint.h is the standard for fixed width types
<cstdint> (stdint.h) - C++ Reference[^]

Types like long, ints etc are not guaranteed to be a given size on different compilers they vary from compiler to compiler.
However a uint64_t is GUARANTEED to always be exactly 64 bits
I would roll the bit counts into uint16_t

So my guess for sexier and type safe version of what you are doing is
C++
#define <stdint.h>
int n = 256; // number of bits in a row/col (or any number that is evenly divisible by 64)
uint64_t *A = new uint64_t[n*n/64]; // stores bits in 64-bit integers
uint64_t *B = new uint64_t[n*n/64]; // for example, one row consists of 256 bits and uses 4x64-bit integers to store them
uint16_t *C  = new uint16_t[n*n];

_kernel void BitProduct(const int N, const __global uint64_t* A, const __global uint64_t* B, __global uint16_t* C) {

}

In vino veritas

GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349220-Mar-18 1:02
User 1370349220-Mar-18 1:02 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer20-Mar-18 3:12
leon de boer20-Mar-18 3:12 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349220-Mar-18 10:09
User 1370349220-Mar-18 10:09 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer20-Mar-18 15:27
leon de boer20-Mar-18 15:27 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349221-Mar-18 3:50
User 1370349221-Mar-18 3:50 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer21-Mar-18 4:25
leon de boer21-Mar-18 4:25 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349221-Mar-18 7:00
User 1370349221-Mar-18 7:00 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer21-Mar-18 16:12
leon de boer21-Mar-18 16:12 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 137034921-Apr-18 18:05
User 137034921-Apr-18 18:05 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer2-Apr-18 18:56
leon de boer2-Apr-18 18:56 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349220-Mar-18 9:07
User 1370349220-Mar-18 9:07 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
Victor Nijegorodov20-Mar-18 9:18
Victor Nijegorodov20-Mar-18 9:18 
QuestionHow to read MS EXCEL workbook in Linux using C++ Pin
Member 179075719-Mar-18 5:55
Member 179075719-Mar-18 5:55 
AnswerRe: How to read MS EXCEL workbook in Linux using C++ Pin
Randor 19-Mar-18 7:11
professional Randor 19-Mar-18 7:11 
AnswerRe: How to read MS EXCEL workbook in Linux using C++ Pin
Victor Nijegorodov19-Mar-18 7:19
Victor Nijegorodov19-Mar-18 7:19 
QuestionCompiling MPI with VS2017 Linux Pin
Kenneth Haugland18-Mar-18 11:10
mvaKenneth Haugland18-Mar-18 11:10 
AnswerRe: Compiling MPI with VS2017 Linux Pin
leon de boer18-Mar-18 14:22
leon de boer18-Mar-18 14:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.