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
diff --git a/src/backend/cpu/memory.cpp b/src/backend/cpu/memory.cpp | |
index 1f0ed5b..45481bc 100644 | |
--- a/src/backend/cpu/memory.cpp | |
+++ b/src/backend/cpu/memory.cpp | |
@@ -87,6 +87,15 @@ namespace cpu | |
T* ptr = NULL; | |
size_t alloc_bytes = divup(sizeof(T) * elements, 1024) * 1024; | |
+ printf("USED BYTES: %zu MB\n", used_bytes >> 20); | |
+ printf("NBUFFERS: %zu\n", memory_map.size()); |
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
array areas(const array& in) | |
{ | |
// Must be 2d image | |
dim4 dims = in.dims(); | |
array flt_in = flat(in); | |
// Corner case: no components | |
array non_zero_ind = where(flt_in != 0); | |
if (non_zero_ind.isempty()) |
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
#include <iostream> | |
#include <limits> | |
#include <arrayfire.h> | |
using namespace std; | |
using namespace af; | |
int comp(const void * elem1, const void * elem2) { | |
int f = *((int*)elem1); | |
int s = *((int*)elem2); |
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
/******************************************************* | |
* Copyright (c) 2014, ArrayFire | |
* All rights reserved. | |
* | |
* This file is distributed under 3-clause BSD license. | |
* The complete license agreement can be obtained at: | |
* http://arrayfire.com/licenses/BSD-3-Clause | |
********************************************************/ | |
#include <iostream> |
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
{"log":"May 23 20:36:08 socket\u0009debug\u0009server.lua: we need to do tls, but delaying until send buffer empty\n","stream":"stdout","time":"2015-05-23T20:36:08.67410023Z"} | |
{"log":"May 23 20:36:08 c2sdeb150\u0009debug\u0009TLS negotiation started for c2s_unauthed...\n","stream":"stdout","time":"2015-05-23T20:36:08.67410023Z"} | |
{"log":"May 23 20:36:08 socket\u0009debug\u0009server.lua: attempting to start tls on tcp{client}: 0xde84a8\n","stream":"stdout","time":"2015-05-23T20:36:08.67410023Z"} |
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
/******************************************************* | |
* Copyright (c) 2014, ArrayFire | |
* All rights reserved. | |
* | |
* This file is distributed under 3-clause BSD license. | |
* The complete license agreement can be obtained at: | |
* http://arrayfire.com/licenses/BSD-3-Clause | |
********************************************************/ | |
#include <arrayfire.h> |
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
-- grayscale | |
Colormap.default = { | |
0 ,0 ,0 | |
,0.0039 ,0.0039 ,0.0039 | |
,0.0078 ,0.0078 ,0.0078 | |
,0.0118 ,0.0118 ,0.0118 | |
,0.0157 ,0.0157 ,0.0157 | |
,0.0196 ,0.0196 ,0.0196 | |
,0.0235 ,0.0235 ,0.0235 | |
,0.0275 ,0.0275 ,0.0275 |
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
#pragma once | |
#include <arrayfire.h> | |
namespace af { | |
static void copy(array &out, const array &in, | |
const index &s0 = span, const index &s1 = span, | |
const index &s2 = span, const index &s3 = span) | |
{ | |
af_array lhs = out.get(); | |
af_array rhs = in.get(); | |
af_index_t indices[] = {s0.get(), s1.get(), s2.get(), s3.get()}; |
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
/******************************************************* | |
* Copyright (c) 2014, ArrayFire | |
* All rights reserved. | |
* | |
* This file is distributed under 3-clause BSD license. |
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
array clip(array in, double lower, double upper) | |
{ | |
return (in >= lower && in <= upper) * in + (in < lower) * lower + (in > upper) * upper; | |
} | |
array clipLower(array in, double lower) | |
{ | |
return(in >= lower) * in + (in < lower) * lower; | |
} |