How to use the sru.sru.SRUFunction._cuda_module function in sru

To help you get started, we’ve selected a few sru examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github musyoku / chainer-sru / sru / sru.py View on Github external
def _cuda_get_module(self):
		if SRUFunction._cuda_module is not None:
			return SRUFunction._cuda_module

		SRUFunction._cuda_module = function.Module()
		
		if cupy_version == 1:
			SRUFunction._cuda_module.load(CUDA_SRU_PTX)
			return SRUFunction._cuda_module

		if cupy_version == 2:
			ls = function.LinkState()
			ls.add_ptr_data(CUDA_SRU_PTX, u"cupy.ptx")
			SRUFunction._cuda_module.load(ls.complete())
			return SRUFunction._cuda_module

		raise NotImplementedError()
github musyoku / chainer-sru / sru / sru.py View on Github external
def _cuda_get_module(self):
		if SRUFunction._cuda_module is not None:
			return SRUFunction._cuda_module

		SRUFunction._cuda_module = function.Module()
		
		if cupy_version == 1:
			SRUFunction._cuda_module.load(CUDA_SRU_PTX)
			return SRUFunction._cuda_module

		if cupy_version == 2:
			ls = function.LinkState()
			ls.add_ptr_data(CUDA_SRU_PTX, u"cupy.ptx")
			SRUFunction._cuda_module.load(ls.complete())
			return SRUFunction._cuda_module

		raise NotImplementedError()
github musyoku / chainer-sru / sru / sru.py View on Github external
def _cuda_get_module(self):
		if SRUFunction._cuda_module is not None:
			return SRUFunction._cuda_module

		SRUFunction._cuda_module = function.Module()
		
		if cupy_version == 1:
			SRUFunction._cuda_module.load(CUDA_SRU_PTX)
			return SRUFunction._cuda_module

		if cupy_version == 2:
			ls = function.LinkState()
			ls.add_ptr_data(CUDA_SRU_PTX, u"cupy.ptx")
			SRUFunction._cuda_module.load(ls.complete())
			return SRUFunction._cuda_module

		raise NotImplementedError()
github musyoku / chainer-sru / sru / sru.py View on Github external
def _cuda_get_module(self):
		if SRUFunction._cuda_module is not None:
			return SRUFunction._cuda_module

		SRUFunction._cuda_module = function.Module()
		
		if cupy_version == 1:
			SRUFunction._cuda_module.load(CUDA_SRU_PTX)
			return SRUFunction._cuda_module

		if cupy_version == 2:
			ls = function.LinkState()
			ls.add_ptr_data(CUDA_SRU_PTX, u"cupy.ptx")
			SRUFunction._cuda_module.load(ls.complete())
			return SRUFunction._cuda_module

		raise NotImplementedError()