This file contains 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
// clang -O3 -march=native deleteme.c -o del_c | |
#include <stdio.h> | |
#include <time.h> | |
int main () { | |
clock_t start, end; | |
double cpu_time_used; | |
int n[ 3000 ]; |
This file contains 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
~ > /Library/Developer/Toolchains/swift-tensorflow-RELEASE-0.7.xctoolchain/usr/bin/swift | |
Welcome to Swift version 5.2-dev. | |
Type :help for assistance. | |
1> import TensorFlow | |
2> let a = Tensor<Int32>(shape: TensorShape([2]), scalars: [0, 1]) | |
*** DESERIALIZATION FAILURE (please include this section in any bug report) *** | |
could not deserialize type for '_cDataType': top-level value not found | |
Cross-reference to module 'CTensorFlow' | |
... TF_DataType |
This file contains 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
deepbern ~/swift-models tensorflow-0.8 * > swift run Personlab | |
warning: you may be able to install libv4l-dev using your system-packager: | |
apt-get install libv4l-dev | |
warning: you may be able to install freeglut3-dev using your system-packager: | |
apt-get install freeglut3-dev | |
warning: you may be able to install mesa-commmon-dev using your system-packager: | |
apt-get install mesa-common-dev |
This file contains 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
// Test motivated by the following discussion: https://twitter.com/vojtamolda/status/1258516339402006528 | |
// Compile script: swiftc -O equal_to_c_speed_test.swift | |
import Foundation | |
// var result = ContiguousArray<Int>(repeating: 0, count: 3001) | |
var result = [Int](repeating: 0, count: 3001) | |
for it in 0..<15 { | |
let start = Date() | |
result.withUnsafeMutableBufferPointer { buffer in |