{ "info": { "author": "Igor Machado and Rodolfo Araujo", "author_email": "igor.machado@ime.uerj.br", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2" ], "description": "The library cudapp is the basis of SimplePyCuda, a simple wrapper for CUDA functions in Python.\nThe idea is to workaround the issues regarding Context in old CUDA versions, that persist on PyCuda.\n\nUsage:\n\n\"make [all]\" will build the lib cudapp.so\n\n\"make run\" will execute \"testSimplePyCuda.py\", using library \"simplepycuda.py\".\n\n==========================\n\nIn Python:\n\n```python\nimport ctypes\nimport numpy\nfrom simplepycuda import SimplePyCuda, SimpleSourceModule, grid, block\n\ndef classicExample(cuda):\n\ta = numpy.random.randn(4,4)\n\ta = a.astype(numpy.float32)\n\tprint a\n\ta_gpu = cuda.mem_alloc(a.nbytes)\n\tcuda.memcpy_htod(a_gpu, a)\n\tmod = SimpleSourceModule(\"\"\"\n #include\n __global__ void doublify ( float* a )\n\t {\n\t int idx = threadIdx.x + threadIdx.y*4;\n\t a[idx] *= 2;\n //printf(\"oi=%d\\\\n\",idx);\n\t }\n\t\"\"\")\n\tfunc = mod.get_function(\"doublify\")\n\t# TODO: this next line will be made automatically in get_function method... just need a few more time :)\n\tfunc.argtypes = [ctypes.c_void_p, grid, block, ctypes.c_ulong, ctypes.c_ulong]\n\tfunc(a_gpu, grid(1,1), block(4,4,1), 0, 0)\n\tcuda.memcpy_dtoh(a, a_gpu)\n\tcuda.deviceSynchronize()\n\tprint a\n\tcuda.free(a_gpu) # this is not necessary in PyCUDA\n\tprint \"Finished\"\n\ndef main():\n\tcuda = SimplePyCuda()\n\n\tclassicExample(cuda)\t\n\treturn 0\n```\n\n[MIT License](LICENSE) - Igor Machado Coelho and Rodolfo Pereira Araujo (2017)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/igormcoelho/simple-pycuda", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "simplepycuda", "package_url": "https://pypi.org/project/simplepycuda/", "platform": "", "project_url": "https://pypi.org/project/simplepycuda/", "project_urls": { "Homepage": "https://github.com/igormcoelho/simple-pycuda" }, "release_url": "https://pypi.org/project/simplepycuda/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "A simple wrapper for CUDA functions in Python.", "version": "0.0.1" }, "last_serial": 4198124, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "3a909c3c03914c9b31148a7b8311a468", "sha256": "6c686507fecc9d4aee50001a3f915fef711c0f2fbc7315eb22c76ca01c4bd339" }, "downloads": -1, "filename": "simplepycuda-0.0.1.tar.gz", "has_sig": false, "md5_digest": "3a909c3c03914c9b31148a7b8311a468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8255, "upload_time": "2018-08-23T00:23:30", "url": "https://files.pythonhosted.org/packages/1e/ae/c7adf1c9a65f6aa7d99bbb22c59cc736ef2ec3bd0eb0a3629783cb21dc53/simplepycuda-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3a909c3c03914c9b31148a7b8311a468", "sha256": "6c686507fecc9d4aee50001a3f915fef711c0f2fbc7315eb22c76ca01c4bd339" }, "downloads": -1, "filename": "simplepycuda-0.0.1.tar.gz", "has_sig": false, "md5_digest": "3a909c3c03914c9b31148a7b8311a468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8255, "upload_time": "2018-08-23T00:23:30", "url": "https://files.pythonhosted.org/packages/1e/ae/c7adf1c9a65f6aa7d99bbb22c59cc736ef2ec3bd0eb0a3629783cb21dc53/simplepycuda-0.0.1.tar.gz" } ] }