func (h *Handle) Idamax(n int, x cuda.Buffer, incx int, result interface{}) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/8, incx) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(xPtr unsafe.Pointer) {
		if h.PointerMode() == Host {
			var resInt C.int
			res = C.cublasIdamax(h.handle, safeIntToC(n), (*C.double)(xPtr),
				safeIntToC(incx), &resInt)
			*(result.(*int)) = int(resInt)
		} else {
			b := result.(cuda.Buffer)
			if b.Size() < 4 {
				panic("buffer underflow")
			}
			b.WithPtr(func(resPtr unsafe.Pointer) {
				res = C.cublasIdamax(h.handle, safeIntToC(n), (*C.double)(xPtr),
					safeIntToC(incx), (*C.int)(resPtr))
			})
		}
	})
	return newError("cublasIdamax", res)
}
Idamax is like Isamax, but for double-precision.

The result argument's type depends on the pointer mode.
In the Host pointer mode, use *int.
In the Device pointer mode, use cuda.Buffer.

This must be called inside the cuda.Context.
package cublas
import (
	"unsafe"
	"github.com/unixpickle/cuda"
)
import "C"
func (h *Handle) Sdot(n int, x cuda.Buffer, incx int, y cuda.Buffer, incy int,
	result interface{}) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/4, incx) < uintptr(n) {
		panic("index out of bounds")
	} else if stridedSize(y.Size()/4, incy) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(xPtr unsafe.Pointer) {
		y.WithPtr(func(yPtr unsafe.Pointer) {
			if h.PointerMode() == Host {
				res = C.cublasSdot(h.handle, safeIntToC(n),
					(*C.float)(xPtr), safeIntToC(incx),
					(*C.float)(yPtr), safeIntToC(incy),
					(*C.float)(result.(*float32)))
			} else {
				b := result.(cuda.Buffer)
				if b.Size() < 4 {
					panic("buffer underflow")
				}
				b.WithPtr(func(outPtr unsafe.Pointer) {
					res = C.cublasSdot(h.handle, safeIntToC(n),
						(*C.float)(xPtr), safeIntToC(incx),
						(*C.float)(yPtr), safeIntToC(incy),
						(*C.float)(outPtr))
				})
			}
		})
	})
	return newError("cublasSdot", res)
}
func (h *Handle) Ddot(n int, x cuda.Buffer, incx int, y cuda.Buffer, incy int,
	result interface{}) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/8, incx) < uintptr(n) {
		panic("index out of bounds")
	} else if stridedSize(y.Size()/8, incy) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(xPtr unsafe.Pointer) {
		y.WithPtr(func(yPtr unsafe.Pointer) {
			if h.PointerMode() == Host {
				res = C.cublasDdot(h.handle, safeIntToC(n),
					(*C.double)(xPtr), safeIntToC(incx),
					(*C.double)(yPtr), safeIntToC(incy),
					(*C.double)(result.(*float64)))
			} else {
				b := result.(cuda.Buffer)
				if b.Size() < 8 {
					panic("buffer underflow")
				}
				b.WithPtr(func(outPtr unsafe.Pointer) {
					res = C.cublasDdot(h.handle, safeIntToC(n),
						(*C.double)(xPtr), safeIntToC(incx),
						(*C.double)(yPtr), safeIntToC(incy),
						(*C.double)(outPtr))
				})
			}
		})
	})
	return newError("cublasDdot", res)
}
func (h *Handle) Sscal(n int, alpha interface{}, x cuda.Buffer, incx int) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/4, incx) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(ptr unsafe.Pointer) {
		if h.PointerMode() == Host {
			pointerizeInputs(&alpha)
			res = C.cublasSscal(h.handle, safeIntToC(n), (*C.float)(alpha.(*float32)),
				(*C.float)(ptr), safeIntToC(incx))
		} else {
			b := alpha.(cuda.Buffer)
			if b.Size() < 4 {
				panic("buffer underflow")
			}
			b.WithPtr(func(alphaPtr unsafe.Pointer) {
				res = C.cublasSscal(h.handle, safeIntToC(n), (*C.float)(alphaPtr),
					(*C.float)(ptr), safeIntToC(incx))
			})
		}
	})
	return newError("cublasSscal", res)
}
func (h *Handle) Dscal(n int, alpha interface{}, x cuda.Buffer, incx int) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/8, incx) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(ptr unsafe.Pointer) {
		if h.PointerMode() == Host {
			pointerizeInputs(&alpha)
			res = C.cublasDscal(h.handle, safeIntToC(n), (*C.double)(alpha.(*float64)),
				(*C.double)(ptr), safeIntToC(incx))
		} else {
			b := alpha.(cuda.Buffer)
			if b.Size() < 8 {
				panic("buffer underflow")
			}
			b.WithPtr(func(alphaPtr unsafe.Pointer) {
				res = C.cublasDscal(h.handle, safeIntToC(n), (*C.double)(alphaPtr),
					(*C.double)(ptr), safeIntToC(incx))
			})
		}
	})
	return newError("cublasDscal", res)
}
func (h *Handle) Saxpy(n int, alpha interface{}, x cuda.Buffer, incx int,
	y cuda.Buffer, incy int) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/4, incx) < uintptr(n) {
		panic("index out of bounds")
	} else if stridedSize(y.Size()/4, incy) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(xPtr unsafe.Pointer) {
		y.WithPtr(func(yPtr unsafe.Pointer) {
			if h.PointerMode() == Host {
				pointerizeInputs(&alpha)
				res = C.cublasSaxpy(h.handle, safeIntToC(n), (*C.float)(alpha.(*float32)),
					(*C.float)(xPtr), safeIntToC(incx),
					(*C.float)(yPtr), safeIntToC(incy))
			} else {
				b := alpha.(cuda.Buffer)
				if b.Size() < 4 {
					panic("buffer underflow")
				}
				b.WithPtr(func(alphaPtr unsafe.Pointer) {
					res = C.cublasSaxpy(h.handle, safeIntToC(n), (*C.float)(alphaPtr),
						(*C.float)(xPtr), safeIntToC(incx),
						(*C.float)(yPtr), safeIntToC(incy))
				})
			}
		})
	})
	return newError("cublasSaxpy", res)
}
func (h *Handle) Daxpy(n int, alpha interface{}, x cuda.Buffer, incx int,
	y cuda.Buffer, incy int) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/8, incx) < uintptr(n) {
		panic("index out of bounds")
	} else if stridedSize(y.Size()/8, incy) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(xPtr unsafe.Pointer) {
		y.WithPtr(func(yPtr unsafe.Pointer) {
			if h.PointerMode() == Host {
				pointerizeInputs(&alpha)
				res = C.cublasDaxpy(h.handle, safeIntToC(n), (*C.double)(alpha.(*float64)),
					(*C.double)(xPtr), safeIntToC(incx),
					(*C.double)(yPtr), safeIntToC(incy))
			} else {
				b := alpha.(cuda.Buffer)
				if b.Size() < 8 {
					panic("buffer underflow")
				}
				b.WithPtr(func(alphaPtr unsafe.Pointer) {
					res = C.cublasDaxpy(h.handle, safeIntToC(n), (*C.double)(alphaPtr),
						(*C.double)(xPtr), safeIntToC(incx),
						(*C.double)(yPtr), safeIntToC(incy))
				})
			}
		})
	})
	return newError("cublasDaxpy", res)
}
func (h *Handle) Isamax(n int, x cuda.Buffer, incx int, result interface{}) error {
	if n < 0 {
		panic("size out of bounds")
	} else if stridedSize(x.Size()/4, incx) < uintptr(n) {
		panic("index out of bounds")
	}
	var res C.cublasStatus_t
	x.WithPtr(func(xPtr unsafe.Pointer) {
		if h.PointerMode() == Host {
			var resInt C.int
			res = C.cublasIsamax(h.handle, safeIntToC(n), (*C.float)(xPtr),
				safeIntToC(incx), &resInt)
			*(result.(*int)) = int(resInt)
		} else {
			b := result.(cuda.Buffer)
			if b.Size() < 4 {
				panic("buffer underflow")
			}
			b.WithPtr(func(resPtr unsafe.Pointer) {
				res = C.cublasIsamax(h.handle, safeIntToC(n), (*C.float)(xPtr),
					safeIntToC(incx), (*C.int)(resPtr))
			})
		}
	})
	return newError("cublasIsamax", res)
}