Skip to content

Commit

Permalink
cutorch
Browse files Browse the repository at this point in the history
** NOTE on API changes and versioning **

Cutorch provides a CUDA backend for torch7.

Cutorch provides the following:

a new tensor type: torch.CudaTensor that acts like torch.FloatTensor, but all it's operations are on the GPU. Most of the tensor operations are supported by cutorch. There are a few missing ones, which are being implemented. The missing list can be found here: torch/cutorch#70
several other GPU tensor types, with limited functionality. Currently limited to copying/conversion, and several indexing and shaping operations.
cutorch.* - Functions to set/get GPU, get device properties, memory usage, set/get low-level streams, set/get random number generator's seed, synchronization etc. They are described in more detail belo
  • Loading branch information
layman committed Dec 4, 2016
1 parent 02a8fcd commit 6136a81
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions sci-libs/torch-cutorch/Manifest
@@ -0,0 +1 @@
EBUILD torch-cutorch-9999.ebuild 1049 SHA256 cad87d53fcdb2b269fbaf8e891e9c512bd6b89649b37e3143860e77568abe20e SHA512 8edcd1dfd4f6f0392eaa8d7086a01a3096987b72cd395dc18804564b312d9a70b6770edd3bfb8582b42d4da85b29c3692ed56a17331cddc11d8639223d1ea06e WHIRLPOOL 32944af6f1a58b0601554cb258fb49b7c6df18948ca7ce11a5d821807cac61bd73d6d05daba419a53d9291f5c3ca2832dc995f7f41bbc25e0509bd3f7409baba
49 changes: 49 additions & 0 deletions sci-libs/torch-cutorch/torch-cutorch-9999.ebuild
@@ -0,0 +1,49 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit git-r3 cmake-utils

DESCRIPTION="Torch module for CUDA."
HOMEPAGE="https://github.com/torch/cutorch"
EGIT_REPO_URI="https://github.com/torch/cutorch.git"

LICENSE="BSD3"
SLOT="0"
KEYWORDS=""
IUSE=""

DEPEND=">=dev-lang/lua-5.1:=
dev-lang/luajit:2
=sci-libs/torch7-9999
>=dev-util/nvidia-cuda-toolkit-7.0"
RDEPEND="${DEPEND}"

src_configure() {
addwrite /dev

local mycmakeargs=(
"-DLUADIR=/usr/lib/lua/5.1"
"-DLUADIR=/usr/share/lua/5.1"
"-DLIBDIR=/usr/lib/lua/5.1"
"-DLUA_BINDIR=/usr/bin"
"-DLUA_INCDIR=/usr/include/luajit-2.0"
"-DLUA_LIBDIR=/usr/lib"
"-DLUALIB=/usr/lib/libluajit-5.1.so"
"-DLUA=/usr/bin/luajit"
)

cmake-utils_src_configure
}

src_install() {
rm -f /dev/nvidia-uvm

cmake-utils_src_install
mkdir -p "${D}"/usr/lib/lua/5.1 "${D}"/usr/share/lua/5.1/
mv "${D}"/usr/lib/libcutorch.so "${D}"/usr/lib/lua/5.1/
mv "${D}"/usr/lua/* "${D}"/usr/share/lua/5.1/
rm -rf "${D}"/usr/lua
}

0 comments on commit 6136a81

Please sign in to comment.