Skip to content

Add templates for double and float types#1

Open
munstermonster wants to merge 1 commit intomasterfrom
develop
Open

Add templates for double and float types#1
munstermonster wants to merge 1 commit intomasterfrom
develop

Conversation

@munstermonster
Copy link
Copy Markdown
Owner

No description provided.


// Allocate top boundary memory
pt_cuSten->boundaryTop = (double**)malloc(pt_cuSten->numTiles * sizeof(double));
pt_cuSten->boundaryTop = (elemType**)malloc(pt_cuSten->numTiles * sizeof(elemType));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and similar lines need to be changed to allocate based on sizeof(elemType*), as it is creating an array of pointers, rather than an array of elemType. This works for double because sizeof(double)==sizeof(double*), however this is not true for floats, causing overflows later on when using floats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants