Here you can find the source of align(int value, int alignment)
Parameter | Description |
---|---|
value | The address value |
alignment | The desired alignment |
public static int align(int value, int alignment)
//package com.java2s; /*/* ww w .j a va 2s . c o m*/ * Copyright (C) 2010-2014 - Andreas Maier * CONRAD is developed as an Open Source project under the GNU General Public License (GPL). */ public class Main { /** * Returns the given (address) value, adjusted to have * the given alignment. In newer versions of JCuda, this * function is also available as JCudaDriver#align * * @param value The address value * @param alignment The desired alignment * @return The aligned address value */ public static int align(int value, int alignment) { return (((value) + (alignment) - 1) & ~((alignment) - 1)); } }