OpenCL1.2 AMD-APP Catastrophic error on compile under Linux - opencl

I am getting the following error when building OpenCL with the AMD-APP SDK on Ubuntu:
Compilation failed:
"/tmp/OCLDUTgN7.cl", line 8: catastrophic error: cannot open source file
"src//owOpenCLConstant.h"
#include "src//owOpenCLConstant.h"
The owOpenCLConstant header file in question contains the following:
#ifndef OW_OPENCL_CONSTANT_H
#define OW_OPENCL_CONSTANT_H
#define MAX_NEIGHBOR_COUNT 32
#define MAX_MEMBRANES_INCLUDING_SAME_PARTICLE 7
#define LIQUID_PARTICLE 1
#define ELASTIC_PARTICLE 2
#define BOUNDARY_PARTICLE 3
#define NO_PARTICLE_ID -1
#define NO_CELL_ID -1
#define NO_DISTANCE -1.0f
#define QUEUE_EACH_KERNEL 1
#define INTEL_OPENCL_DEBUG 0
#endif // #ifndef OW_OPENCL_CONSTANT_H
This works with the Intel OpenCL1.1 SDK so it seems a bit strange. Is it an AMD-specific problem or could it be an OpenCL1.1 vs 1.2 thing?
I don't know much about OpenCL and haven't been able to find this error anywhere, if anyone can spot the problem I would greatly appreciate it.

Related

Read Arduino Hardware specifications in C++

I recently started into C++ and Arduino Coding which makes a lot of fun! I have different boards for example an Arduino UNO R3, Arduino Mini and an Arduino compatible Teensy 3.2.
I'd like to make my program to automatically select specific pins. Over the EEPROM library (not sure if library is the right term, as I said im new to c++) I can get the EEPROM size of each board. Is there any way to get other datas as how many digital/analgs pins the board has which can be used as Input and Output pins?
The number of digital pins is defined in the NUM_DIGITAL_PINS macro.
The number of analog input pins is defined in the NUM_ANALOG_INPUTS macro.
The macros are located at(added by request of OP):
Uno: https://github.com/arduino/Arduino/blob/1.6.12/hardware/arduino/avr/variants/standard/pins_arduino.h#L28-L29
#define NUM_DIGITAL_PINS 20
#define NUM_ANALOG_INPUTS 6
Mini: https://github.com/arduino/Arduino/blob/1.6.12/hardware/arduino/avr/variants/standard/pins_arduino.h#L28
#define NUM_DIGITAL_PINS 20
and
https://github.com/arduino/Arduino/blob/1.6.12/hardware/arduino/avr/variants/eightanaloginputs/pins_arduino.h#L25
#include "../standard/pins_arduino.h"
#undef NUM_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 8
Teensy 3.x:
https://github.com/PaulStoffregen/cores/blob/1.31/teensy3/core_pins.h#L97-L127
#if defined(__MK20DX128__)
#define CORE_NUM_TOTAL_PINS 34
#define CORE_NUM_DIGITAL 34
#define CORE_NUM_INTERRUPT 34
#define CORE_NUM_ANALOG 14
#define CORE_NUM_PWM 10
#elif defined(__MK20DX256__)
#define CORE_NUM_TOTAL_PINS 34
#define CORE_NUM_DIGITAL 34
#define CORE_NUM_INTERRUPT 34
#define CORE_NUM_ANALOG 21
#define CORE_NUM_PWM 12
#elif defined(__MKL26Z64__)
#define CORE_NUM_TOTAL_PINS 27
#define CORE_NUM_DIGITAL 27
#define CORE_NUM_INTERRUPT 24 // really only 18, but 6 "holes"
#define CORE_NUM_ANALOG 13
#define CORE_NUM_PWM 10
#elif defined(__MK64FX512__)
#define CORE_NUM_TOTAL_PINS 64
#define CORE_NUM_DIGITAL 64
#define CORE_NUM_INTERRUPT 64
#define CORE_NUM_ANALOG 27
#define CORE_NUM_PWM 20
#elif defined(__MK66FX1M0__)
#define CORE_NUM_TOTAL_PINS 64
#define CORE_NUM_DIGITAL 64
#define CORE_NUM_INTERRUPT 64
#define CORE_NUM_ANALOG 25
#define CORE_NUM_PWM 22
#endif
and
https://github.com/PaulStoffregen/cores/blob/1.31/teensy3/pins_arduino.h#L157-L158
#define NUM_DIGITAL_PINS CORE_NUM_DIGITAL
#define NUM_ANALOG_INPUTS CORE_NUM_ANALOG
The will be found in similar locations for other boards. You just need to check the build.variant value set in boards.txt for that board and then go to the folder of the same name under the variants folder of the board's platform.
You might find some other useful things by looking through those variant files.

how to transmit with Nreadings>5

I am trying to set Nreadings in the Oscilloscope header file in tinyos above 5,say I set it at 6. When I do this, I notice that transmissions cease that is the green led does not blink signalling no transmissions are happening and instead I notice the red LED toggling telling me that there is an error. I went into the tos/types directory and opened message.h ,here I changed message length and set it to 56 from 28 as follows:
ifndef __MESSAGE_H__
#define __MESSAGE_H__
#include "platform_message.h"
#ifndef TOSH_DATA_LENGTH
#define TOSH_DATA_LENGTH 56
#endif
#ifndef TOS_BCAST_ADDR
#define TOS_BCAST_ADDR 0xFFFF
#endif
typedef nx_struct message_t {
nx_uint8_t header[sizeof(message_header_t)];
nx_uint8_t data[TOSH_DATA_LENGTH];
nx_uint8_t footer[sizeof(message_footer_t)];
nx_uint8_t metadata[sizeof(message_metadata_t)];
} message_t;
After making the above change I downloaded the Oscilloscope application onto my mote,yet the problem persists,am I missing something? After making the change to message_t, do I need to do compile something before i download the code?

Is there a #define _KEYWORD_ in arduino.h to check against?

I would prefer to use standard Arduino API's if they are available. I need a way to check if arduino.h is present. If it is not available (i.e. executing code on BeagleBone Black), then I can use my own functions.
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Taken from: http://www.arduino.cc/en/Main/ReleaseNotes [internals]

Setting Application Information in Qt

I have now pretty much finished my application in Qt. I want to deploy it and among other things I would like to set the application information when someone right clicks the executable file and looks at the details.
The best source of information I found was this link: Setting application info in a Qt executable file on Windows
However, in Qt5, after creating a .qrc file and a prefix, I couldn't get it to work. If the .qrc file is edited outside of Qt, an unknown error always occurs when opening it inside Qt.
Can anybody please provide me with an working example? The way it's shown in the link above is exactly what I would like to do.
Thanks in advance!
Just create file "resources.rc" with Qt Creator "File"->"New File of Project.."->"General"->"Text file" or with any text editor in your project folder with this context:
IDI_ICON1 ICON DISCARDABLE "res/app.ico"
#include <windows.h>
#include "version.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
You should also have header file "version.h" in your project:
#ifndef VERSION_H
#define VERSION_H
#define VER_FILEVERSION 1,0,0,0
#define VER_FILEVERSION_STR "1.0.0.0\0"
#define VER_PRODUCTVERSION 1,0,0,0
#define VER_PRODUCTVERSION_STR "1.0\0"
#define VER_COMPANYNAME_STR "Your Organization"
#define VER_FILEDESCRIPTION_STR "CoolApplication"
#define VER_INTERNALNAME_STR "CoolApplication"
#define VER_LEGALCOPYRIGHT_STR "Copyright © 2010 Your Organization"
#define VER_LEGALTRADEMARKS1_STR "All Rights Reserved"
#define VER_LEGALTRADEMARKS2_STR VER_LEGALTRADEMARKS1_STR
#define VER_ORIGINALFILENAME_STR "coolapplication.exe"
#define VER_PRODUCTNAME_STR "CoolApplication"
#define VER_COMPANYDOMAIN_STR "example.org"
#endif // VERSION_H
Then in your *.pro file add
RC_FILE = file_prop_detail.rc
That is all. This aproach worked for me with Qt 5.4.

Arduino: error: 'abs' was not declared in this scope

I'm working on an arduino library needing the abs() function:
#include <math.h>
normTransFreq1 = abs(1.0);
Error: 'abs' was not declared in this scope
As math.h is already included in the cpp I'm entirely unsure how to fix this problem. A new install of arduino 1.5.2 didn't help.
Just found the solution:
Including math.h is not needed for the library. Instead, Arduino.h should be included by adding the following to the header file:
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

Resources