From the cuda documentaion, cudaMemset2D is used to memset memory allocated by cudaMallocPitch. It is mentioned that "Pitch is used to meet alignment requirements for coalescing". The pitch size is returned by cudaMallocPitch function.
Question is, if my I allocate the memory with normal cudaMalloc, and define a pitch size myself (which is not necessarily a multiple of 128).
Can cudaMemset2D and other 2D functions be used for this memory?