# Error: Unaligned memory accesses not supported

**URL:** <https://forums.developer.nvidia.com/t/error-unaligned-memory-accesses-not-supported/12439>\
**Category:** CUDA Programming and Performance\
**Created:** [September 28, 2009, 7:46pm UTC](https://forums.developer.nvidia.com/t/error-unaligned-memory-accesses-not-supported/12439 "2009-09-28T19:46:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![erik.rostock](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@erik.rostock](https://forums.developer.nvidia.com/u/erik.rostock)\
**Post date:** [September 28, 2009, 7:46pm UTC](https://forums.developer.nvidia.com/t/error-unaligned-memory-accesses-not-supported/12439/1 "2009-09-28T19:46:53Z")

</div>

Hi,

I have declared a struct as follows:

```auto
typedef unsigned int fieldSet;

typedef unsigned int fieldSetDouble;

struct __align(16)__ task {

	fieldSet cols;

	fieldSet rows;

	fieldSetDouble diagP;

	fieldSetDouble diagN;

	int nextRow;

};

```

The following code gives me an error when compiling:

\_

```auto
_device__ void initTask(task* t) {

	t->cols = 0;

	t->rows = 0;

	t->diagP = 0;

	t->diagN = 0;

	t->nextRow = 0;

}

```

Each line inside the function gives an “Error: Unaligned memory accesses not supported”.

I’ve searched the forums and there are some threads referencing this error, but none discuses this specific issue. At least I couldn’t figure out :P

So, if you can help me! Thanks a lot!

Erik
