Skip to content

Commit

Permalink
Add logger.h (Tencent#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxint authored May 12, 2020
1 parent b5868cc commit ceef247
Show file tree
Hide file tree
Showing 32 changed files with 323 additions and 320 deletions.
1 change: 0 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

macro(ncnn_add_example name)
add_executable(${name} ${name}.cpp)
target_compile_options(${name} PRIVATE -std=c++11)
target_link_libraries(${name} PRIVATE ncnn ${OpenCV_LIBS})

# add test to a virtual project group
Expand Down
111 changes: 55 additions & 56 deletions src/allocator.cpp

Large diffs are not rendered by default.

129 changes: 64 additions & 65 deletions src/command.cpp

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// specific language governing permissions and limitations under the License.

#include "cpu.h"
#include "platform.h"

#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <vector>

Expand Down Expand Up @@ -231,7 +231,7 @@ static int get_cpucount()

if (count > (int)sizeof(size_t) * 8)
{
fprintf(stderr, "more than %d cpu detected, thread affinity may not work properly :(\n", (int)sizeof(size_t) * 8);
NCNN_LOGE("more than %d cpu detected, thread affinity may not work properly :(", (int)sizeof(size_t) * 8);
}

return count;
Expand Down Expand Up @@ -354,7 +354,7 @@ typedef struct
int syscallret = syscall(__NR_sched_setaffinity, pid, sizeof(mask), &mask);
if (syscallret)
{
fprintf(stderr, "syscall error %d\n", syscallret);
NCNN_LOGE("syscall error %d", syscallret);
return -1;
}

Expand All @@ -373,7 +373,7 @@ int set_cpu_powersave(int powersave)
{
if (powersave < 0 || powersave > 2)
{
fprintf(stderr, "powersave %d not supported\n", powersave);
NCNN_LOGE("powersave %d not supported", powersave);
return -1;
}

Expand Down Expand Up @@ -404,7 +404,7 @@ static int setup_thread_affinity_masks()
{
int max_freq_khz = get_max_freq_khz(i);

// fprintf(stderr, "%d max freq = %d khz\n", i, max_freq_khz);
// NCNN_LOGE("%d max freq = %d khz", i, max_freq_khz);

cpu_max_freq_khz[i] = max_freq_khz;

Expand Down Expand Up @@ -461,7 +461,7 @@ size_t get_cpu_thread_affinity_mask(int powersave)
if (powersave == 2)
return g_thread_affinity_mask_big;

fprintf(stderr, "powersave %d not supported\n", powersave);
NCNN_LOGE("powersave %d not supported", powersave);

// fallback to all cores anyway
return g_thread_affinity_mask_all;
Expand Down
4 changes: 3 additions & 1 deletion src/datareader.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
#ifndef NCNN_DATAREADER_H
#define NCNN_DATAREADER_H

#include <stdio.h>
#include "platform.h"
#if NCNN_STDIO || NCNN_STRING
#include <stdio.h>
#endif

#if __ANDROID_API__ >= 9
#include <android/asset_manager.h>
Expand Down
Loading

0 comments on commit ceef247

Please sign in to comment.