This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ "$#" != "1" ]; then | |
| echo -e "Usage: cuda [on|off]" | |
| exit 1 | |
| fi | |
| if [ "$1" == "on" -o "$1" == "ON" ]; then | |
| sudo tee /proc/acpi/bbswitch <<<ON | |
| sleep 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Calculate the thread global position, taken it's thread position within the block. | |
| __device__ __inline__ uint3 __getGlobalPosition (uint3 blockIdx, dim3 blockDim, uint3 threadIdx) { | |
| return make_uint3(blockIdx.x * blockDim.x + threadIdx.x, blockIdx.y * blockDim.y + threadIdx.y, blockIdx.z * blockDim.z + threadIdx.z); | |
| }; | |
| // Device function to return the index of a given thread within a block. | |
| __device__ __inline__ unsigned int __tIndex(uint3 b, dim3 bd, uint3 t) { | |
| return t.x + t.y*bd.x + t.z*bd.x*bd.z; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass[12pt,utf8,twocolumn,a4paper]{article} | |
| \usepackage[utf8]{inputenc} | |
| \usepackage[brazilian]{babel} | |
| \usepackage{mathtools} | |
| \usepackage{amsmath} | |
| \usepackage{graphicx} | |
| \usepackage[margin=2cm]{geometry} | |
| \newcommand{\sidenote}[1]{\marginpar{\footnotesize{#1}}} | |
| \newcommand{\drawspace}[2]{\setlength{\unitlength}{#1}\begin{picture}(1,1)\end{picture}\\{\footnotesize #2}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string hByte(unsigned int bytes){ | |
| string r; | |
| if (bytes <= 0) r = "0 Bytes"; | |
| else if (bytes >= 1073741824) r = to_string(bytes/1073741824) + " GBytes"; | |
| else if (bytes >= 1048576) r = to_string(bytes/1048576) + " MBytes"; | |
| else if (bytes >= 1024) r = to_string(bytes/1024) + " KBytes"; | |
| return r; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Prism: Lightweight, robust, elegant syntax highlighting | |
| * MIT license http://www.opensource.org/licenses/mit-license.php/ | |
| * @author Lea Verou http://lea.verou.me | |
| */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[ |
NewerOlder