1.fix data structure redefine warnings.
2.fix 'data' with variable sized type 'union<*>' not at the end of a class warning(in immediate.hpp).
3.fix implicitly conversion warning.
4.fix explicitly assigning a variable type warning.
5.fix comparison of unsigned expression < 0 is always false warning(in cl_api.c).
Signed-off-by: Lv Meng <meng.lv@intel.com>
Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
// for all the branching instruction. And need to adjust the distance
// for those branch instruction's start point and end point contains
// this instruction.
- GenNativeInstruction *insn2 = (GenNativeInstruction *)&this->store[insnID+2];
- GBE_ASSERT(insn2->header.opcode == GEN_OPCODE_NOP);
- insn2 = insn2;
+ GBE_ASSERT(((GenNativeInstruction *)&this->store[insnID+2])->header.opcode == GEN_OPCODE_NOP);
insn.header.opcode = GEN_OPCODE_ADD;
this->setDst(&insn, GenRegister::ip());
this->setSrc0(&insn, GenRegister::ip());
// from the RA map.
bool success = expireReg(interval.reg);
GBE_ASSERT(success);
- success = success;
+ if(!success) return success;
RA.erase(interval.reg);
}
spilledRegs.insert(std::make_pair(interval.reg, spillTag));
int optLevel);
extern gbe_program_new_from_llvm_cb *gbe_program_new_from_llvm;
-/*! create s new genprogram for link. */
-typedef gbe_program (gbe_program_new_gen_program_cb)(uint32_t deviceID,
- const void *module,
- const void *act);
-extern gbe_program_new_gen_program_cb *gbe_program_new_gen_program;
-
/*! link the programs from llvm level. */
typedef void (gbe_program_link_from_llvm_cb)(gbe_program dst_program,
gbe_program src_program,
}
private:
+ ImmType type; //!< Type of the value
+ uint32_t elemNum; //!< vector imm data type
+ uint64_t defaultData;
union {
bool *b;
int8_t *s8;
const Immediate *immVec[];
void *p;
} data; //!< Value to store
- ImmType type; //!< Type of the value
- uint32_t elemNum; //!< vector imm data type
- uint64_t defaultData;
Immediate & operator= (const Immediate &);
- Immediate operator+ (const Immediate &) const;
- Immediate operator- (const Immediate &) const;
- Immediate operator* (const Immediate &) const;
- Immediate operator/ (const Immediate &) const;
- Immediate operator% (const Immediate &) const;
- Immediate operator& (const Immediate &) const;
- Immediate operator| (const Immediate &) const;
- Immediate operator^ (const Immediate &) const;
- Immediate operator<< (const Immediate &) const;
- Immediate operator>> (const Immediate &) const;
+ Immediate operator+ (const Immediate &) const;
+ Immediate operator- (const Immediate &) const;
+ Immediate operator* (const Immediate &) const;
+ Immediate operator/ (const Immediate &) const;
+ Immediate operator% (const Immediate &) const;
+ Immediate operator& (const Immediate &) const;
+ Immediate operator| (const Immediate &) const;
+ Immediate operator^ (const Immediate &) const;
+ Immediate operator<< (const Immediate &) const;
+ Immediate operator>> (const Immediate &) const;
static Immediate lshr (const Immediate &left, const Immediate &right);
-
-
void copy(const Immediate &other, int32_t offset, uint32_t num);
GBE_CLASS(Immediate);
};
goto error;
}
- if (offset < 0 || offset + size > buffer->size) {
+ if (offset + size > buffer->size) {
err = CL_INVALID_VALUE;
goto error;
}
goto error;
}
- if (src_offset < 0 || src_offset + cb > src_buffer->size) {
+ if (src_offset + cb > src_buffer->size) {
err = CL_INVALID_VALUE;
goto error;
}
- if (dst_offset < 0 || dst_offset + cb > dst_buffer->size) {
+ if (dst_offset + cb > dst_buffer->size) {
err = CL_INVALID_VALUE;
goto error;
}
cl_gpgpu_bind_image(gpgpu, k->images[i].idx, image->base.bo, image->offset,
image->intel_fmt, image->image_type,
image->w, image->h, image->depth,
- image->row_pitch, image->tiling);
+ image->row_pitch, (cl_gpgpu_tiling)image->tiling);
if (image->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY)
cl_gpgpu_bind_image(gpgpu, k->images[i].idx + 128, image->base.bo, image->offset,
image->intel_fmt, image->image_type,
image->w, image->h, image->depth,
- image->row_pitch, image->tiling);
+ image->row_pitch, (cl_gpgpu_tiling)image->tiling);
}
return CL_SUCCESS;
}
#ifndef __CL_CONTEXT_H__
#define __CL_CONTEXT_H__
+#include "CL/cl.h"
#include "cl_internals.h"
#include "cl_driver.h"
-#include "CL/cl.h"
#include "cl_khr_icd.h"
#include <stdint.h>
#include "cl_context.h"
#include "cl_mem.h"
-typedef struct _cl_context *cl_context;
typedef cl_buffer (cl_buffer_alloc_from_texture_cb)(cl_context, unsigned int, int, unsigned int,
struct _cl_mem_image *gl_image);
* will allow us to make the use of a software performance simulator easier and
* to minimize the code specific for the HW and for the simulator
**************************************************************************/
+#ifndef __CL_DRIVER_TYPE_H__
+#define __CL_DRIVER_TYPE_H__
/* Encapsulates command buffer / data buffer / kernels */
typedef struct _cl_buffer *cl_buffer;
typedef struct _cl_gpgpu_event *cl_gpgpu_event;
typedef struct _cl_context_prop *cl_context_prop;
-typedef struct _cl_sampler *cl_sampler;
+
+#endif
/* All user events complete, now wait enqueue events */
ret = cl_event_wait_events(enqueue_cb->num_events, enqueue_cb->wait_list,
enqueue_cb->event->queue);
- ret = ret;
assert(ret != CL_ENQUEUE_EXECUTE_DEFER);
-
+ ret = ~ret;
cb = enqueue_cb;
enqueue_cb = enqueue_cb->next;
char ext_str[256];
} cl_extensions_t;
-struct _cl_platform_id;
-typedef struct _cl_platform_id * cl_platform_id;
-
extern void
cl_intel_platform_extension_init(cl_platform_id intel_platform);
.max_samplers = 16,
.mem_base_addr_align = sizeof(cl_long) * 16 * 8,
.min_data_type_align_size = sizeof(cl_long) * 16,
-.single_fp_config = 0, /* XXX */
.double_fp_config = 0,
.global_mem_cache_type = CL_READ_WRITE_CACHE,
.global_mem_size = 1024 * 1024 * 1024,
#ifndef __CL_PLATFORM_ID_H__
#define __CL_PLATFORM_ID_H__
+#include "CL/cl.h"
#include "cl_internals.h"
#include "cl_extensions.h"
#include "cl_khr_icd.h"
-#include "CL/cl.h"
-
#include "src/OCLConfig.h"
struct _cl_platform_id {
static _EGLContext *
_eglLookupContext(EGLContext ctx, EGLDisplay disp)
{
- disp = disp;
return (_EGLContext *) ctx;
}
char magic[2];
int ret;
ret = fread(&magic[0], 1, 2, fp);
- ret = ret;
- assert(2 == ret);
+ if(2 != ret){
+ fclose(fp);
+ free(bmppath);
+ return NULL;
+ }
assert(magic[0] == 'B' && magic[1] == 'M');
ret = fread(&hdr, sizeof(hdr), 1, fp);
- assert(1 == ret);
+ if(1 != ret){
+ fclose(fp);
+ free(bmppath);
+ return NULL;
+ }
assert(hdr.width > 0 && hdr.height > 0 && hdr.nplanes == 1 && hdr.compression == 0);